vue单页面应用进入页面加载所有 js 问题
一般在index.js中都是这么引入的组件importfrom '@/pages/my'import Cart from '@/pages/cart'import Order from '@/pages/order'import TMap from '@/pages/map'import New from '@/pages/new'换成这样就好啦const My = r => r..
·
一般在index.js中都是这么引入的组件
import from '@/pages/my'
import Cart from '@/pages/cart'
import Order from '@/pages/order'
import TMap from '@/pages/map'
import New from '@/pages/new'
换成这样就好啦
const My = r => require.ensure([], () => r(require('@/pages/my')), 'my')
const Cart = r => require.ensure([], () => r(require('@/pages/cart')), 'cart')
const Order = r => require.ensure([], () => r(require('@/pages/order')), 'order')
const TMap = r => require.ensure([], () => r(require('@/pages/map')), 'map')
const New = r => require.ensure([], () => r(require('@/pages/new')), 'new')
更多推荐
已为社区贡献11条内容
所有评论(0)