Skip to content

[vue] 怎么实现路由懒加载呢? #374

Open
@haizhilin2013

Description

@haizhilin2013
Collaborator

[vue] 怎么实现路由懒加载呢?

Activity

tjNane

tjNane commented on Jun 28, 2019

@tjNane

import异步加载

Zjingbo

Zjingbo commented on Jul 2, 2019

@Zjingbo

百度的话有很多方法,不过我一般都用箭头函数的方法 component:()=>import('组件路径')

miqidian

miqidian commented on Aug 6, 2019

@miqidian

resolve

iugu516

iugu516 commented on Sep 11, 2019

@iugu516

const component = () =>import('./....')

WenJieLi1998

WenJieLi1998 commented on Apr 19, 2020

@WenJieLi1998

1.vue的异步组件:resolve=>require(['需要异步加载的组件'],resolve)
2.es6的import方法:()=>import(需要异步加载的组件)
3.webpack的 require.ensure: r => require.ensure([],()=>r( require(需要异步加载的组件)),chunkName)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      No branches or pull requests

        Participants

        @miqidian@haizhilin2013@tjNane@WenJieLi1998@Zjingbo

        Issue actions

          [vue] 怎么实现路由懒加载呢? · Issue #374 · haizlin/fe-interview