vue引入组件import与require方式

2020-01-12 13:27
11189
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:01:31.0
In tens, please (ten pound notes) <a href="http://plateroytu.com/skelaxin-kidney-stones">skelaxin maximum daily dose</a> Lots of incidental contact, but should it have been a foul? Anteaters coach Russell Turner bit his tongue.
2020-10-25 10:01:31.0
I'd like to pay this cheque in, please <a href="http://anvil.me/erectafil-20-mg-reviews">buy erectafil-5</a> In 2007, angry iPod Nano customers filed a lawsuit against Apple for only providing 7.45 GB of storage in their 8 GB iPods (less than 7% for those scoring at home)
2020-10-25 10:01:30.0
I'm doing a phd in chemistry <a href="http://na-da.co.jp/buy-casodex">casodex cost us</a> The proposal would have also required pet ferrets be sterilized and vaccinated for rabies.
2020-10-25 10:01:30.0
I came here to work <a href="http://purelove.dk/como-comprar-bupropiona.htm">venlafaxine bupropion american journal of psychiatry</a> Dozens more - including one aimed at Kazakhstan &mdash; are in registration with the U.S
2020-10-25 10:01:28.0
I'd like to pay this cheque in, please <a href="http://urbanmission.co.uk/over-the-counter-antiviral-medicine-for-herpes">meclizine hcl 25mg tab side effects</a> The dollar fell slightly against a basket of majorcurrencies but trimmed early losses against the euro and yen onthe U.S
2020-10-25 09:39:15.0
Very funny pictures <a href="http://www.coachhiredirect.co.uk/buy-aricept-wiyhout-a-prisception/">generic aricept photo</a> One of the reasons the Islamic State group does things like beheadings is that it gets a lot of reaction for one, low-tech act of murder
2020-10-25 09:39:15.0
Could you ask her to call me? <a href="http://www.kiralikevara.com/finasteride-cost-uk/">finasteride propecia proscar side effects</a> Some examples of prominent Wall Street names heading to thebitcoin industry include Blythe Masters, former head ofcommodities trading at JPMorgan Chase & Co, who recentlybecame chief executive of bitcoin trading firm Digital AssetsHoldings LLC
2020-10-25 09:39:14.0
Do you know what extension he's on? <a href="http://asoupar.ir/?dose-of-lisinopril-hctz">lisinopril 25 mg cost</a> Actual battery life is always going to vary depending on how you use a device, but based on my time with the tablets, I'd say those estimates should be quite attainable for most people.
2020-10-25 09:39:13.0
I'm only getting an answering machine <a href="http://alzheimersdiseasetreatment.com/colostomy-bag-change-icd-10">colospa x tablet price</a> The increase in non-lethal aid to Ukraine, which is grappling with a Russian-backed separatist movement in its east, is expected to be announced on Thursday during a visit to Kiev by Vice President Joe Biden.
2020-10-25 09:39:13.0
Can I take your number? <a href="http://asoupar.ir/?dose-of-lisinopril-hctz">lisinopril-hydrochlorothiazide oral side effects</a> "Drillingresults have identified two sweet spots where we are focusingour activity