vue引入组件import与require方式

2020-01-12 13:27
12056
31922

开发一个微信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-12 03:57:36.0
Through friends <a href="https://www.lbcfrisco.org/prost-xtra-plus-uk-w6u1">prost xtra plus uk </a> In weekly press conferences and postgame comments, in private one-on-one interviews and national television spots, Manning rarely has referenced Indianapolis, almost never says the word Colts or mentions his former teammates by name, unless speaking in generalities about retired greats such as Marshall Faulk or Marvin Harrison.
2020-10-12 03:57:36.0
I was made redundant two months ago <a href="https://www.emprendedordigital.info/metronidazole-flagyl-250-mg-5ysu">prescription flagyl used</a> Proia and Treasury Department spokesman Adam Hodge wouldn't comment on whether the government plans a gradual sale of the shares instead of an IPO. "The IPO continues to be a viable option," Proia said. "We can't comment any further at this point."
2020-10-12 03:57:35.0
Could you transfer $1000 from my current account to my deposit account? <a href="http://allsydneytowtrucks.com.au/pharmacy/index.php/forum-achat-viagra-en-ligne-8mj5">viagra tek tablet fiyat</a> Is humanity&#8217;s &#8220;purpose&#8221; to cover every bare inch of soil with people living hand-to-mouth subsistence lives that can best be summarized as short, brutal and nasty? Maybe we need to give some thought to raising our grade of &#8216;F&#8217; for getting world population back down to a level that is sustainable by our earth? There is no road down which this can can be kicked further.
2020-10-12 03:57:35.0
Do you need a work permit? <a href="https://www.gopperu.com/what-is-the-use-of-megalis-tablet-zr7s">what is the use of megalis tablet</a> Kenya requested a "red alert" wanted notice issued byInterpol for Lewthwaite, dubbed the "White Widow" by the Britishmedia, but said she was wanted in connection with a previous2011 plot that was also linked by police to al Shabaab.
2020-10-12 03:56:41.0
Could I borrow your phone, please? <a href="http://www.wepsolutions.co.in/clarithromycin-iv-dose-pediatric-efiy">clarithromycin for uti infection</a> Cheney, the 46-year-old daughter of former Vice President Dick Cheney, moved to Wyoming last year with her family to eye political opportunities. She had hoped Enzi would retire, but when he formally announced his re-election earlier Tuesday, she suddenly announced she would join him, a decision that sets the stage for a contentious Republican primary fight.
2020-10-12 03:56:40.0
Good crew it's cool :) <a href="http://fizjoterapia.biz/alliance-hc-contact-isrv">weight loss alli or orlistat</a> For standard kit and cabin space at this price point, there is little to trouble the CX-5. The 2.0-litre petrol engine must be worked hard to get any performance, while the 2.2-litre diesels are far less frantic. The 148bhp unit, which returns 61.4mpg, pulls well throughout the rev range so the 173bhp engine is rather redundant.
2020-10-12 03:56:40.0
I'm on work experience <a href="http://www.boysanisiyalitim.com/max-stamina-wheel-botw-pzco">botw max stamina elixir</a> Of course the structures and underpinnings of the special relationship will militate against further change, and will seek to recuperate the losses incurred. But the reality is that the British population, in its overwhelming majority, rejects interventionist war and the grandiose and anachronistic notions which our leaders have - of Britain as a "war-fighting nation". People may want to be a force for good in the world but they no longer believe that involves killing other people.
2020-10-12 03:56:39.0
Where did you go to university? <a href="http://fizjoterapia.biz/how-to-get-rid-of-lexapro-withdrawal-xa2n">lexapro 20mg preo gotas </a> Deputy Prime Minister Bulent Arinc has questioned whetherthe protesters really represent Alevis, saying the aim was tocreate the same harmony found in other Turkish cities wherechurches and mosques often sit in close proximity.
2020-10-12 03:56:39.0
I'm in my first year at university <a href="https://kiemtoancalico.com/levocetirizine--montelukast-tablets-uses-hindi-eiyb">montelukast & levocetirizine hydrochloride syrup</a> Cate Blanchett is in full-on tragicomic Oscar-bait mode as the title character, a Birkin bag-wielding Manhattan socialite whose world, and psyche, collapses along with the voodoo accounting of her fraudster financier husband (Alec Baldwin, wonderfully reptilian). She crosses to &ldquo;the other side,&rdquo; in every sense, to throw herself on the not-so-tender mercies of her sister Ginger (Sally Hawkins), living a hardscrabble life in San Francisco with her rough-diamond boyfriend Chilli (Bobby Cannavale).
2020-10-12 03:52:36.0
Is there ? <a href="http://ebike4all.com/naproxen-sodium-safety-data-sheet-uu6m">naproxen 375 vs ibuprofen</a> Caterpillar Inc was the biggest drag on the Dow,falling 1.6 percent to $82.14. The stock slid for the secondday, extending a selloff that began on Wednesday after theworld's largest maker of mining and construction equipment cutits 2013 earnings forecast.