vue引入组件import与require方式

2020-01-12 13:27
11190
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-14 11:06:38.0
What part of do you come from? <a href="https://shesfashionbd.com/methylprednisolone-4-mg-for-sinus-infection-lfmh">can you drink while on methylprednisolone</a> Perhaps echoing popular opinion, Johnson's anti-EU stance has hardened over the last year. In May, he claimed that Britain should be ready to leave if David Cameron was not able to renegotiate its membership after the 2015 election. But in January the mayor told the World Economic Forum in Davos that his "overwhelming instinct" would be to vote to stay in the EU if it came to a vote.
2020-10-14 11:06:38.0
very best job <a href="http://www.kabouing.com/levofloxacino-500mg-bula-hvbq">levofloxacina dosis maxima</a> Nevertheless, the Australian dollar was a bigger mover afterthe RBA lowered its cash rate by a quarter point to a record lowof 2.5 percent, a cut which was fully factored in. Some hadgeared up for a 50 basis point cut and a form of forwardguidance or pledge to keep rates low, analysts said.
2020-10-14 11:06:37.0
Please wait <a href="http://www.racinlinks.com/wellbutrin-sr-better-than-xl-reddit-ya9c">wellbutrin sr 100mg twice a day</a> In New York, the exchange is not able to transfer data tosome insurers instantaneously, as planned, one carrier toldReuters. Instead, the data will be sent in batches once a day orso. The glitch will not affect customers, but it raisesquestions that New York might have other IT problems.
2020-10-14 11:06:37.0
How much will it cost to send this letter to ? <a href="https://intuitionrise.com/vitaros-gel-cena-000f">vitaros 3 mg/g creme</a> Carrie Ann Inaba got quite the surprise when she guest hosted 'Live with Regis and Kelly.' The 'Dancing with the Stars' judge unknowingly took part in an elaborate plan that involved her boyfriend of two years, Jesse Sloan, popping the question on live TV. Shortly after exclaiming 'Yes!,' Inaba showed off her 2½-carat, D-color, princess-cut diamond solitaire platinum ring from Rafinity.
2020-10-14 11:06:21.0
How much notice do you have to give? <a href="http://www.weekendcruise.co.uk/atarax-10mg-syrup/">can i buy atarax in australia</a> A peaceful 2013 election helped restore aid but economists say deep reforms are needed.
2020-10-14 11:06:20.0
I didn't go to university <a href="https://reklametotaal.nl/buy-albuterol-liquid-1rr1">buy albuterol liquid</a> Officials said they would also promote Dubai as a centre forIslamic tourism, education and fashion, though they did not givedetails of those initiatives. (Reporting by Andrew Torchia and Mirna Sleiman; editing by TomPfeiffer)
2020-10-14 11:06:19.0
Can I use your phone? <a href="http://heraldrybydesign.com/has-anyone-tried-generic-renova">tretinoin is in what products</a> The mother of three babies whose bodies were found amid tons of trash and dirty diapers in a Blackstone home earlier this year has been indicted on murder charges in connection with their deaths, Worcester County District Attorney Joe Early said Tuesday.
2020-10-14 11:06:19.0
Can I take your number? <a href="https://www.mvv27.nl/wordpress/proventil-and-ventolin-qxrz">ventolin manufacturer contact</a> Taylor appears in a video pushing over a sandstone boulder that had been perched on a sandy pillar at Goblin Valley State Park in southern Utah. Hall shot the video and both men hoot and holler and celebrate with high fives after the rock falls.
2020-10-14 11:06:19.0
Canada>Canada <a href="http://www.elifile.com/strattera-on-rxlist/">atomoxetine withdrawal symptoms</a> Coba (45 minutes away) is the least developed and, in many ways, the most exciting &ndash; you need to hire a bicycle and pedal through the dense woodland to see it all
2020-10-14 11:06:18.0
The line's engaged <a href="http://www.sedrez.com/bestsellers/index.php/meloxicam-cinfa-75-mg-uq8t">harga meloxicam</a> Acolytes attest to transformations of the sort enjoyed by its creator: scars eradicated, bloom restored. In the past, I have come across Crème used for burns, heart-surgery scars, babies&rsquo; bottoms, my (sceptical doctor) father&rsquo;s Second World War injuries and the feet of ballerina Tamara Rojo.