vue引入组件import与require方式

2020-01-12 13:27
11187
31918

开发一个微信H5商城,路由配置如下: { path: '/home', name: 'home', meta: { name: '艾优购商城', title: '艾优购商城' }, component: resolve => require(['@/components/home'], resolve) }

对component:home和 component: resolve => require(['@/components/home'], resolve)配置方式的却别做如下记录: 准确来说是后者配置是为了懒加载: import:当项目打包时路由里的所有component(组件)都会打包在一个js中,造成进入首页时,需要加载的内容过多,时间相对比较长。 require:这种方式引入的时候,会将你的component(组件)分别打包成不同的js,加载的时候也是按需加载,只用访问这个路由网址时才会加载这个js。

全部评论

2020-10-25 10:46:05.0
good material thanks <a href="http://urbanmission.co.uk/ginseng-aj-cena">resep sup ginseng korea</a> Snow White, although still just a little girl, managed to convince the huntsman to spare her life
2020-10-25 10:46:04.0
Looking for a job <a href="http://www.sivits.org/precio-actual-de-las-computadoras-vit">tadora 20 mg side effects</a> He said the decline in PC sales appears to have leveled out, based on the company's own projections and recent reports from independent market research firms
2020-10-25 10:46:04.0
About a year <a href="http://cityweddings.co.uk/lasix-heart-failure-management/">lasix eye surgery salem oregon</a> The Commission announced on Thursday that it had sent formal charge sheets to several manufacturers it suspected of price fixing, marking the next phase of a complex investigation that began with raids on a number of companies' headquarters in January 2011.
2020-10-25 10:46:04.0
Whereabouts are you from? <a href="http://www.stonematrix.com/lazarus-naturals-cbd-capsules-25mg.html">cbd oil for anxiety vape</a> If you would like more information on dementia and Alzheimer's including, caring for someone affected, the ASI runs a national helpline Monday to Friday, from 10am to 5pm, and Saturday, from 10am to 4pm
2020-10-25 10:46:03.0
I love the theatre <a href="http://www.sivits.org/precio-actual-de-las-computadoras-vit">tadora</a> One of the countries worst-hit by Europe's economic crisis,Spain is now one of the continent's fastest growing economies,but unemployment remains high and most Spaniards are still along way from recovering pre-crisis living standards.
2020-10-25 10:23:57.0
I'd like to send this to <a href="http://zobbing.co.uk/cost-of-celebrex-at-walmart">para que es celebrex 100 mg</a> Either the writer was going to do these things to me, or they were what I deserved
2020-10-25 10:23:52.0
What sort of music do you listen to? <a href="http://vaccineresource.com/buy-unique-hoodia-australia/">hoodia prix</a> A water spout, which is like a tornado but occurs overwater, was sighted over the ocean near Los Angeles InternationalAirport on Friday morning, and another one formed 35 miles (56kms) to the southeast off Newport Beach.
2020-10-25 10:23:51.0
Your cash is being counted <a href="http://kbtlund.se/cheapest-family-vacations-in-california">best family vacations 2018 usa</a> "We are not yet positive exactly what caused the deaths,whether it was an overdose, or contaminated drugs," a policespokeswoman said
2020-10-25 10:23:50.0
Do you know the number for ? <a href="http://lg303.com/harga-obat-generik-cefixime">cefixime oral suspension uses in tamil</a> Zachary Goldberger, the study&rsquo;s lead author from the University of Washington Harborview Medical Center in Seattle.
2020-10-25 10:23:47.0
My battery's about to run out <a href="http://www.imengaged.org/vasotec-iv-onset-duration.html">enalapril 10 mg para que sirve</a> Barclays, Royal Bank of Scotland and LloydsBanking Group have been fined for the attempted manipulation ofthe Libor financial benchmark, while HSBC and RBS werefined for failing to stop traders from manipulating the foreignexchange market.