vue引入组件import与require方式

2020-01-12 13:27
11186
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 11:29:41.0
I'd like to pay this in, please <a href="http://purelove.dk/carduran-neo-8-mg-efectos-secundarios.htm">doxazosin 4mg tablets</a> There's been considerable talk about the Washington Redskins' name, which many consider a racial slur
2020-10-25 11:29:40.0
I'd like to change some money <a href="http://dohon.co.jp/dapagliflozin-side-effects-uk">forxiga bula medicamento</a> "Britain&#039;s cancer survival rates compare poorly with other countries in Europe
2020-10-25 11:29:40.0
Not in at the moment <a href="http://www.pinkmail.org/inderal-haldol/">calibrators propranolol</a> Children who need to access dermatology services at Temple Street Children's Hospital now face being placed on an additional waiting list due to a lack of specialists, the Irish Skin Foundation (ISF) has warned.
2020-10-25 11:29:40.0
Could you tell me my balance, please? <a href="http://www.pinkmail.org/inderal-haldol/">propranolol hydrocholride</a> Meanwhile, over 36,000 breath tests were carried out on drivers at more than 7,500 checkpoints nationwide, with around 20 drivers being arrested every day on suspicion of driving while intoxicated
2020-10-25 11:29:39.0
Good crew it's cool :) <a href="http://www.eidon.se/compazine-10-mg-for-nausea/">compazine no prescriptionbuy</a> They hold them in a dozen places around the country, scouting for free agents while publicizing their brand at the same time.
2020-10-25 11:07:40.0
I'd like to withdraw $100, please <a href="http://www.custom-creations.org/grifulvin-v-500-tablet">grifulvin dosage for small adult</a> Then there's a huge image of the national championship trophy on a banner on the side of the indoor field
2020-10-25 11:07:40.0
What do you do? <a href="http://vonjuliet.com.tr/fungus-on-feet-ketoconazole-cream">fish fungus ketoconazole lowest price</a> "We enjoyed the music of Sting with a Celtic flair and having him perform it was special," the lawyer told the Daily News.
2020-10-25 11:07:39.0
I saw your advert in the paper <a href="http://italiannetwork.co.uk/tegretol-xr-medscape">tegretol dosage for neuropathic pain</a> According to the pressure group Jubilee Debt Campaign Greece&#8217;s debt pile has grown from 133 percent in 2010 to nearly 177 of economic output now
2020-10-25 11:07:38.0
I do some voluntary work <a href="http://dohon.co.jp/compazine-iv-uses">a href order compazine</a> In the past year, six new anticancer therapies were approved by the FDA, and new uses for five already-approved anticancer drugs were approved
2020-10-25 11:07:38.0
An accountancy practice <a href="http://vonjuliet.com.tr/fungus-on-feet-ketoconazole-cream">ketoconazole cvs</a> Iranian President Hassan Rouhani has blamed the rise of violent extremism on what he called &#8220;certain states&#8221; and on unidentified &#8220;intelligence agencies&#8221; which, he said, have put &#8220;blades in the hands of madmen.&#8221;