当前位置: 首页 > news >正文

玉林做网站5151app是交友软件么

玉林做网站,5151app是交友软件么,wordpress 页面禁止评论,网站备案查询 站长的怎么实现1 . vue异步组件技术 异步加载 vue-router配置路由 , 使用vue的异步组件技术 , 可以实现按需加载 . 但是,这种情况下一个组件生成一个js文件 /* vue异步组件技术 */ { path: /home, name: home, component: resolve > require([/components/home],resolve) }, { path…

1 . vue异步组件技术 ==== 异步加载 

vue-router配置路由 , 使用vue的异步组件技术 , 可以实现按需加载 . 

但是,这种情况下一个组件生成一个js文件

/* vue异步组件技术 */

{ path: '/home', name: 'home', component: resolve => require(['@/components/home'],resolve) },
{ path: '/index', name: 'Index', component: resolve => require(['@/components/index'],resolve) },
{ path: '/about', name: 'about', component: resolve => require(['@/components/about'],resolve) }

2.组件懒加载方案二 路由懒加载(使用import)

const 组件名=() => import('组件路径');
// 下面2行代码,没有指定webpackChunkName,每个组件打包成一个js文件。
/* const Home = () => import('@/components/home')
const Index = () => import('@/components/index')
const About = () => import('@/components/about') */
// 下面2行代码,指定了相同的webpackChunkName,会合并打包成一个js文件。
把组件按组分块
const Home = () => import(/* webpackChunkName: 'ImportFuncDemo' */ '@/components/home')
const Index = () => import(/* webpackChunkName: 'ImportFuncDemo' */ '@/components/index')
const About = () => import(/* webpackChunkName: 'ImportFuncDemo' */ '@/components/about'){ path: '/about', component: About }, { path: '/index', component: Index }, { path: '/home', component: Home }

3.webpack提供的require.ensure()  

vue-router配置路由,使用webpack的require.ensure技术,也可以实现按需加载。 
这种情况下,多个路由指定相同的chunkName,会合并打包成一个js文件。
/* 组件懒加载方案三: webpack提供的require.ensure() */
{ path: '/home', name: 'home', component: r => require.ensure([], () => r(require('@/components/home')), 'demo') },
{ path: '/index', name: 'Index', component: r => require.ensure([], () => r(require('@/components/index')), 'demo') },
{ path: '/about', name: 'about', component: r => require.ensure([], () => r(require('@/components/about')), 'demo-01') }// r就是resolve
const list = r => require.ensure([], () => r(require('../components/list/list')), 'list');
// 路由也是正常的写法  这种是官方推荐的写的 按模块划分懒加载 
const router = new Router({routes: [{path: '/list/blog',component: list,name: 'blog'}]
})

 

http://www.mmbaike.com/news/35065.html

相关文章:

  • 天津哪家做网站好网站关键词如何快速上首页
  • 鞍山网站建设找金航营销团队公司
  • 自适应 网站新闻危机公关
  • 小程序源码开发网站关键词排名优化电话
  • 网站建设公司售后客服人员要求seo排名点击报价
  • 泡泡vps俄国做网站seo优化
  • 可以做锚文本链接的网站可以进入任何网站的浏览器
  • 做网站在阿里云买什么推广普通话手抄报图片
  • 公司网站建设成本网站免费建站app
  • 网站会员营销营销软文范例500
  • 做零售出口的网站如何营销推广自己的产品
  • 沈阳世纪兴网站建设手机自动排名次的软件
  • 建网站需要什么步骤百度官方优化指南
  • 安阳做网站哪家好seo查询软件
  • 重庆哪家做网站如何用手机免费创建网站
  • 深圳网站关键词排名外包推广公司
  • 那个网站做粮油批发APP福州seo代理商
  • 一般用什么语言做网站制作网页的软件
  • 做企业网站收费多少万网域名官网
  • 中华人民共和国城乡住房建设厅网站一个公司可以做几个百度推广
  • 什么网站可以做宣传单谷歌搜索为什么用不了
  • .net美食网站开发源代码网络营销所学课程
  • 西安网页开发公司seo与sem的关系
  • 织梦后台怎么做网站地图seo排名第一
  • 外贸网站网站推广实体店铺引流推广方法
  • 封面上的网站怎么做今天的新闻最新消息
  • 如何制作出优秀的ui设计seo计费系统登录
  • 哈尔滨建站模板源码全自动推广引流软件
  • 长沙做网站咨询公司网站建设公司
  • 基础做网站的小结网站开发教程