vue引入组件import与require方式

2020-01-12 13:27
11188
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:07:24.0
What do you like doing in your spare time? <a href="http://teknogeyik.net/celestolite-5de1">celestolite london prices</a> Seats from as recently as five years ago weighed almost 29 pounds, said Mark Hiller, CEO of Recaro Aircraft Seating. Its lightest seat now weighs 20. The weight savings comes from things like using plastic armrests instead of metal with a plastic cover, or on some seats replacing the metal pan that holds a passenger's posterior with mesh netting. Also, the new seats have fewer parts, reducing weight and costs.
2020-10-14 11:07:23.0
I'd like to tell you about a change of address <a href="https://isapointdecroix.fr/synthroid-88-mcg-cost-57cx">where should synthroid be stored in the pharmacy</a> "The repeated brinkmanship over raising the debt ceiling also dents confidence in the effectiveness of the U.S. government and political institutions, and in the coherence and credibility of economic policy," Fitch said.
2020-10-14 11:07:23.0
Remove card <a href="http://sachihouse.edu.vn/pharmacy/index.php/prostamol-forte-9brm">prostamol uno dawkowanie</a> Cable, who earlier this week accused Labour of irresponsibly talking up the value of the shares, repeatedly defended the privatization's price tag over questions about whether the value of this portfolio had been correctly assessed.
2020-10-14 11:07:22.0
I like watching football <a href="https://www.mvv27.nl/wordpress/prospecto-de-ciprofloxacino-500-xsxw">bula cloridrato de ciprofloxacino prati</a> Telenet's TV penetration stands at 73% and is believed to command in the region of 75%-80% TV market share within its franchise area. Belgium incumbent, Belgacom, is nonetheless regarded as having done an effective job in developing its own TV product (reporting 26% TV market share at Q113) and multi-service customer base.
2020-10-14 11:07:04.0
I'm doing a phd in chemistry <a href="https://analoggulf.com/albuterol-dosage-for-horses-9y9s">obat albuterol untuk apa</a> The state's largest generating company, Dallas-basedLuminant, seeks permits to potentially add 800 MW ofsimple-cycle gas plants while No. 2, NRG Energy, isconsidering adding 2,000 MW at three existing Texas powerplants.
2020-10-14 11:07:04.0
I'd like to transfer some money to this account <a href="http://elajedrezdelvirrey.com/1000-mg-acetaminophen-800-mg-ibuprofen-2dwd">ibuprofeno cinfamed 400 mg</a> "She was not a mere spectator," U.S. District Judge Steven McAuliffe said. "I find this defendant was actively involved, actively participated, in the mass killing of men, women and children simply because they were Tutsis."
2020-10-14 11:07:03.0
I like watching football <a href="http://baysys.ca/etoricoxib-puren-90-mg-nebenwirkungen-riz3">etoricoxib tablet in pakistan</a> The Yankees, whose 2013 payroll soared over $220 million, the highest total ever, could have anywhere from $50 million to $100 million coming off the books, depending on whether Granderson and Hiroki Kuroda re-sign and whether Alex Rodriguez misses all of next year due to suspension, so they’ll have some financial flexibility.
2020-10-14 11:07:01.0
Children with disabilities <a href="https://clickaway.com.bd/how-much-infant-tylenol-to-give-20-lb-baby-wj9f">take tylenol and ibuprofen at the same time</a> That may be a hopeful sign not only for Apple shareholdersbut for Apple-dependent broker-dealers. In the meantime,however, analysts assume that the Apple effect on marginaccounts goes beyond TD Ameritrade.
2020-10-14 11:07:00.0
I'd like to open a business account <a href="https://happylights.pk/phyto-power-caps-o-que-py8p">quem fabrica o phyto power caps</a> Merck does not disclose sales data related to Zilmax. ButKevin Kedra, an animal health analyst for Gabelli & Co, saidMerck has little to lose financially from the Zilmax controversyand the loss of Tyson's business because it is a niche productcompared with the company's array of human pharmaceuticals thatbring in more than $36 billion a year.
2020-10-14 11:06:39.0
Very Good Site <a href="https://hiepthanhland.com/dapoxetine-60mg-uses-3m1w">dapoxetine 60 mg price in hindi</a> “The United States should never have to choose, for example, whether to pay Social Security to seniors, pay benefits to our veterans, or make payments to state and local jurisdictions and health care providers under Medicare and Medicaid,” Treasury Secretary Jacob Lew said Wednesday.