vendor.js 197 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696369736983699370037013702370337043705370637073708370937103711371237133714371537163717371837193720372137223723372437253726372737283729373037313732373337343735373637373738373937403741374237433744374537463747374837493750375137523753375437553756375737583759376037613762376337643765376637673768376937703771377237733774377537763777377837793780378137823783378437853786378737883789379037913792379337943795379637973798379938003801380238033804380538063807380838093810381138123813381438153816381738183819382038213822382338243825382638273828382938303831383238333834383538363837383838393840384138423843384438453846384738483849385038513852385338543855385638573858385938603861386238633864386538663867386838693870387138723873387438753876387738783879388038813882388338843885388638873888388938903891389238933894389538963897389838993900390139023903390439053906390739083909391039113912391339143915391639173918391939203921392239233924392539263927392839293930393139323933393439353936393739383939394039413942394339443945394639473948394939503951395239533954395539563957395839593960396139623963396439653966396739683969397039713972397339743975397639773978397939803981398239833984398539863987398839893990399139923993399439953996399739983999400040014002400340044005400640074008400940104011401240134014401540164017401840194020402140224023402440254026402740284029403040314032403340344035403640374038403940404041404240434044404540464047404840494050405140524053405440554056405740584059406040614062406340644065406640674068406940704071407240734074407540764077407840794080408140824083408440854086408740884089409040914092409340944095409640974098409941004101410241034104410541064107410841094110411141124113411441154116411741184119412041214122412341244125412641274128412941304131413241334134413541364137413841394140414141424143414441454146414741484149415041514152415341544155415641574158415941604161416241634164416541664167416841694170417141724173417441754176417741784179418041814182418341844185418641874188418941904191419241934194419541964197419841994200420142024203420442054206420742084209421042114212421342144215421642174218421942204221422242234224422542264227422842294230423142324233423442354236423742384239424042414242424342444245424642474248424942504251425242534254425542564257425842594260426142624263426442654266426742684269427042714272427342744275427642774278427942804281428242834284428542864287428842894290429142924293429442954296429742984299430043014302430343044305430643074308430943104311431243134314431543164317431843194320432143224323432443254326432743284329433043314332433343344335433643374338433943404341434243434344434543464347434843494350435143524353435443554356435743584359436043614362436343644365436643674368436943704371437243734374437543764377437843794380438143824383438443854386438743884389439043914392439343944395439643974398439944004401440244034404440544064407440844094410441144124413441444154416441744184419442044214422442344244425442644274428442944304431443244334434443544364437443844394440444144424443444444454446444744484449445044514452445344544455445644574458445944604461446244634464446544664467446844694470447144724473447444754476447744784479448044814482448344844485448644874488448944904491449244934494449544964497449844994500450145024503450445054506450745084509451045114512451345144515451645174518451945204521452245234524452545264527452845294530453145324533453445354536453745384539454045414542454345444545454645474548454945504551455245534554455545564557455845594560456145624563456445654566456745684569457045714572457345744575457645774578457945804581458245834584458545864587458845894590459145924593459445954596459745984599460046014602460346044605460646074608460946104611461246134614461546164617461846194620462146224623462446254626462746284629463046314632463346344635463646374638463946404641464246434644464546464647464846494650465146524653465446554656465746584659466046614662466346644665466646674668466946704671467246734674467546764677467846794680468146824683468446854686468746884689469046914692469346944695469646974698469947004701470247034704470547064707470847094710471147124713471447154716471747184719472047214722472347244725472647274728472947304731473247334734473547364737473847394740474147424743474447454746474747484749475047514752475347544755475647574758475947604761476247634764476547664767476847694770477147724773477447754776477747784779478047814782478347844785478647874788478947904791479247934794479547964797479847994800480148024803480448054806480748084809481048114812481348144815481648174818481948204821482248234824482548264827482848294830483148324833483448354836483748384839484048414842484348444845484648474848484948504851485248534854485548564857485848594860486148624863486448654866486748684869487048714872487348744875487648774878487948804881488248834884488548864887488848894890489148924893489448954896489748984899490049014902490349044905490649074908490949104911491249134914491549164917491849194920492149224923492449254926492749284929493049314932493349344935493649374938493949404941494249434944494549464947494849494950495149524953495449554956495749584959496049614962496349644965496649674968496949704971497249734974497549764977497849794980498149824983498449854986498749884989499049914992499349944995499649974998499950005001500250035004500550065007500850095010501150125013501450155016501750185019502050215022502350245025502650275028502950305031503250335034503550365037503850395040504150425043504450455046504750485049505050515052505350545055505650575058505950605061506250635064506550665067506850695070507150725073507450755076507750785079508050815082508350845085508650875088508950905091509250935094509550965097509850995100510151025103510451055106510751085109511051115112511351145115511651175118511951205121512251235124512551265127512851295130513151325133513451355136513751385139514051415142514351445145514651475148514951505151515251535154515551565157515851595160516151625163516451655166516751685169517051715172517351745175517651775178517951805181518251835184518551865187518851895190519151925193519451955196519751985199520052015202520352045205520652075208520952105211521252135214521552165217521852195220522152225223522452255226522752285229523052315232523352345235523652375238523952405241524252435244524552465247524852495250525152525253525452555256525752585259526052615262526352645265526652675268526952705271527252735274527552765277527852795280528152825283528452855286528752885289529052915292529352945295529652975298529953005301530253035304530553065307530853095310531153125313531453155316531753185319532053215322532353245325532653275328532953305331533253335334533553365337533853395340534153425343534453455346534753485349535053515352535353545355535653575358535953605361536253635364536553665367536853695370537153725373537453755376537753785379538053815382538353845385538653875388538953905391539253935394539553965397539853995400540154025403540454055406540754085409541054115412541354145415541654175418541954205421542254235424542554265427542854295430543154325433543454355436543754385439544054415442544354445445544654475448544954505451545254535454545554565457545854595460546154625463546454655466546754685469547054715472547354745475547654775478547954805481548254835484548554865487548854895490549154925493549454955496549754985499550055015502550355045505550655075508550955105511551255135514551555165517551855195520552155225523552455255526552755285529553055315532553355345535553655375538553955405541554255435544554555465547554855495550555155525553555455555556555755585559556055615562556355645565556655675568556955705571557255735574557555765577557855795580558155825583558455855586558755885589559055915592559355945595559655975598559956005601560256035604560556065607560856095610561156125613561456155616561756185619562056215622562356245625562656275628562956305631563256335634563556365637563856395640564156425643564456455646564756485649565056515652565356545655565656575658565956605661566256635664566556665667566856695670567156725673567456755676567756785679568056815682568356845685568656875688568956905691569256935694569556965697569856995700570157025703570457055706570757085709571057115712571357145715571657175718571957205721572257235724572557265727572857295730573157325733573457355736573757385739574057415742574357445745574657475748574957505751575257535754575557565757575857595760576157625763576457655766576757685769577057715772577357745775577657775778577957805781578257835784578557865787578857895790579157925793579457955796579757985799580058015802580358045805580658075808580958105811581258135814581558165817581858195820582158225823582458255826582758285829583058315832583358345835583658375838583958405841584258435844584558465847584858495850585158525853585458555856585758585859586058615862586358645865586658675868586958705871587258735874587558765877587858795880588158825883588458855886588758885889589058915892589358945895589658975898589959005901590259035904590559065907590859095910591159125913591459155916591759185919592059215922592359245925592659275928592959305931593259335934593559365937593859395940594159425943594459455946594759485949595059515952595359545955595659575958595959605961596259635964596559665967596859695970597159725973597459755976597759785979598059815982598359845985598659875988598959905991599259935994599559965997599859996000600160026003600460056006600760086009601060116012601360146015601660176018601960206021602260236024602560266027602860296030603160326033603460356036603760386039604060416042604360446045604660476048604960506051605260536054605560566057605860596060606160626063606460656066606760686069607060716072607360746075607660776078607960806081608260836084608560866087608860896090609160926093609460956096609760986099610061016102610361046105610661076108610961106111611261136114611561166117611861196120612161226123612461256126612761286129613061316132613361346135613661376138613961406141614261436144614561466147614861496150615161526153615461556156615761586159616061616162616361646165616661676168616961706171617261736174617561766177617861796180618161826183618461856186618761886189619061916192619361946195619661976198619962006201620262036204620562066207620862096210621162126213621462156216621762186219622062216222622362246225622662276228622962306231623262336234623562366237623862396240624162426243624462456246624762486249625062516252625362546255625662576258625962606261626262636264626562666267626862696270627162726273627462756276627762786279628062816282628362846285628662876288628962906291629262936294629562966297629862996300630163026303630463056306630763086309631063116312631363146315631663176318631963206321632263236324632563266327632863296330633163326333633463356336633763386339634063416342634363446345634663476348634963506351635263536354635563566357635863596360636163626363636463656366636763686369637063716372637363746375637663776378637963806381638263836384638563866387638863896390639163926393639463956396639763986399640064016402640364046405640664076408640964106411641264136414641564166417641864196420642164226423642464256426642764286429643064316432643364346435643664376438643964406441644264436444644564466447644864496450645164526453645464556456645764586459646064616462646364646465646664676468646964706471647264736474647564766477647864796480648164826483648464856486648764886489649064916492649364946495649664976498649965006501650265036504650565066507650865096510651165126513651465156516651765186519652065216522652365246525652665276528652965306531653265336534653565366537653865396540654165426543654465456546654765486549655065516552655365546555655665576558655965606561656265636564656565666567656865696570657165726573657465756576657765786579658065816582658365846585658665876588658965906591659265936594659565966597659865996600660166026603660466056606660766086609661066116612661366146615661666176618661966206621662266236624662566266627662866296630663166326633663466356636663766386639664066416642664366446645664666476648664966506651665266536654665566566657665866596660666166626663666466656666666766686669667066716672667366746675667666776678667966806681668266836684668566866687668866896690669166926693669466956696669766986699670067016702670367046705670667076708670967106711671267136714671567166717671867196720672167226723672467256726672767286729673067316732673367346735673667376738673967406741674267436744674567466747674867496750675167526753675467556756675767586759676067616762676367646765676667676768676967706771677267736774677567766777677867796780678167826783678467856786678767886789679067916792679367946795679667976798679968006801680268036804680568066807680868096810681168126813681468156816681768186819682068216822682368246825682668276828682968306831683268336834683568366837683868396840684168426843684468456846684768486849685068516852685368546855685668576858685968606861686268636864686568666867686868696870687168726873687468756876687768786879688068816882688368846885688668876888688968906891689268936894689568966897689868996900690169026903690469056906690769086909691069116912691369146915691669176918691969206921692269236924692569266927692869296930693169326933693469356936693769386939694069416942694369446945694669476948694969506951695269536954695569566957695869596960696169626963696469656966696769686969697069716972697369746975697669776978697969806981698269836984698569866987698869896990699169926993699469956996699769986999700070017002700370047005700670077008700970107011701270137014701570167017701870197020702170227023702470257026702770287029703070317032703370347035703670377038703970407041704270437044704570467047704870497050705170527053705470557056705770587059706070617062706370647065706670677068706970707071707270737074707570767077707870797080708170827083708470857086708770887089709070917092709370947095709670977098709971007101710271037104710571067107710871097110711171127113711471157116711771187119712071217122712371247125712671277128712971307131713271337134713571367137713871397140714171427143714471457146714771487149715071517152715371547155715671577158715971607161716271637164716571667167716871697170717171727173717471757176717771787179718071817182718371847185718671877188718971907191719271937194719571967197719871997200720172027203720472057206720772087209721072117212721372147215721672177218721972207221722272237224722572267227722872297230723172327233723472357236723772387239724072417242724372447245724672477248724972507251725272537254725572567257725872597260726172627263726472657266726772687269727072717272727372747275727672777278727972807281728272837284728572867287728872897290729172927293729472957296729772987299730073017302730373047305730673077308730973107311731273137314731573167317731873197320732173227323732473257326732773287329733073317332733373347335733673377338733973407341734273437344734573467347734873497350735173527353735473557356735773587359736073617362736373647365736673677368736973707371737273737374737573767377737873797380738173827383738473857386738773887389739073917392739373947395739673977398739974007401740274037404740574067407740874097410741174127413741474157416741774187419742074217422742374247425742674277428742974307431743274337434743574367437743874397440744174427443744474457446744774487449745074517452745374547455745674577458745974607461746274637464746574667467746874697470747174727473747474757476747774787479748074817482748374847485748674877488748974907491749274937494749574967497749874997500750175027503750475057506750775087509751075117512751375147515751675177518751975207521752275237524752575267527752875297530753175327533753475357536753775387539754075417542754375447545754675477548754975507551755275537554755575567557755875597560756175627563756475657566756775687569757075717572757375747575757675777578757975807581758275837584758575867587758875897590759175927593759475957596759775987599760076017602760376047605760676077608760976107611761276137614761576167617
  1. (global["webpackJsonp"] = global["webpackJsonp"] || []).push([["common/vendor"],[
  2. /* 0 */
  3. /*!**********************************************************!*\
  4. !*** C:/Users/lenovo/Desktop/新建文件夹/gaobaoUniApp/main.js ***!
  5. \**********************************************************/
  6. /*! no static exports found */
  7. /***/ (function(module, exports, __webpack_require__) {
  8. "use strict";
  9. /* WEBPACK VAR INJECTION */(function(createApp) {__webpack_require__(/*! uni-pages */ 4);
  10. var _vue = _interopRequireDefault(__webpack_require__(/*! vue */ 2));
  11. var _App = _interopRequireDefault(__webpack_require__(/*! ./App */ 5));function _interopRequireDefault(obj) {return obj && obj.__esModule ? obj : { default: obj };}function _objectSpread(target) {for (var i = 1; i < arguments.length; i++) {var source = arguments[i] != null ? arguments[i] : {};var ownKeys = Object.keys(source);if (typeof Object.getOwnPropertySymbols === 'function') {ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function (sym) {return Object.getOwnPropertyDescriptor(source, sym).enumerable;}));}ownKeys.forEach(function (key) {_defineProperty(target, key, source[key]);});}return target;}function _defineProperty(obj, key, value) {if (key in obj) {Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true });} else {obj[key] = value;}return obj;}
  12. _vue.default.config.productionTip = false;
  13. _App.default.mpType = 'app';
  14. var app = new _vue.default(_objectSpread({},
  15. _App.default));
  16. createApp(app).$mount();
  17. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./node_modules/@dcloudio/uni-mp-weixin/dist/index.js */ 1)["createApp"]))
  18. /***/ }),
  19. /* 1 */
  20. /*!************************************************************!*\
  21. !*** ./node_modules/@dcloudio/uni-mp-weixin/dist/index.js ***!
  22. \************************************************************/
  23. /*! no static exports found */
  24. /***/ (function(module, exports, __webpack_require__) {
  25. "use strict";
  26. Object.defineProperty(exports, "__esModule", { value: true });exports.createApp = createApp;exports.createComponent = createComponent;exports.createPage = createPage;exports.default = void 0;var _vue = _interopRequireDefault(__webpack_require__(/*! vue */ 2));function _interopRequireDefault(obj) {return obj && obj.__esModule ? obj : { default: obj };}function _slicedToArray(arr, i) {return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _nonIterableRest();}function _nonIterableRest() {throw new TypeError("Invalid attempt to destructure non-iterable instance");}function _iterableToArrayLimit(arr, i) {var _arr = [];var _n = true;var _d = false;var _e = undefined;try {for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) {_arr.push(_s.value);if (i && _arr.length === i) break;}} catch (err) {_d = true;_e = err;} finally {try {if (!_n && _i["return"] != null) _i["return"]();} finally {if (_d) throw _e;}}return _arr;}function _arrayWithHoles(arr) {if (Array.isArray(arr)) return arr;}function _defineProperty(obj, key, value) {if (key in obj) {Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true });} else {obj[key] = value;}return obj;}function _toConsumableArray(arr) {return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _nonIterableSpread();}function _nonIterableSpread() {throw new TypeError("Invalid attempt to spread non-iterable instance");}function _iterableToArray(iter) {if (Symbol.iterator in Object(iter) || Object.prototype.toString.call(iter) === "[object Arguments]") return Array.from(iter);}function _arrayWithoutHoles(arr) {if (Array.isArray(arr)) {for (var i = 0, arr2 = new Array(arr.length); i < arr.length; i++) {arr2[i] = arr[i];}return arr2;}}
  27. var _toString = Object.prototype.toString;
  28. var hasOwnProperty = Object.prototype.hasOwnProperty;
  29. function isFn(fn) {
  30. return typeof fn === 'function';
  31. }
  32. function isStr(str) {
  33. return typeof str === 'string';
  34. }
  35. function isPlainObject(obj) {
  36. return _toString.call(obj) === '[object Object]';
  37. }
  38. function hasOwn(obj, key) {
  39. return hasOwnProperty.call(obj, key);
  40. }
  41. function noop() {}
  42. /**
  43. * Create a cached version of a pure function.
  44. */
  45. function cached(fn) {
  46. var cache = Object.create(null);
  47. return function cachedFn(str) {
  48. var hit = cache[str];
  49. return hit || (cache[str] = fn(str));
  50. };
  51. }
  52. /**
  53. * Camelize a hyphen-delimited string.
  54. */
  55. var camelizeRE = /-(\w)/g;
  56. var camelize = cached(function (str) {
  57. return str.replace(camelizeRE, function (_, c) {return c ? c.toUpperCase() : '';});
  58. });
  59. var HOOKS = [
  60. 'invoke',
  61. 'success',
  62. 'fail',
  63. 'complete',
  64. 'returnValue'];
  65. var globalInterceptors = {};
  66. var scopedInterceptors = {};
  67. function mergeHook(parentVal, childVal) {
  68. var res = childVal ?
  69. parentVal ?
  70. parentVal.concat(childVal) :
  71. Array.isArray(childVal) ?
  72. childVal : [childVal] :
  73. parentVal;
  74. return res ?
  75. dedupeHooks(res) :
  76. res;
  77. }
  78. function dedupeHooks(hooks) {
  79. var res = [];
  80. for (var i = 0; i < hooks.length; i++) {
  81. if (res.indexOf(hooks[i]) === -1) {
  82. res.push(hooks[i]);
  83. }
  84. }
  85. return res;
  86. }
  87. function removeHook(hooks, hook) {
  88. var index = hooks.indexOf(hook);
  89. if (index !== -1) {
  90. hooks.splice(index, 1);
  91. }
  92. }
  93. function mergeInterceptorHook(interceptor, option) {
  94. Object.keys(option).forEach(function (hook) {
  95. if (HOOKS.indexOf(hook) !== -1 && isFn(option[hook])) {
  96. interceptor[hook] = mergeHook(interceptor[hook], option[hook]);
  97. }
  98. });
  99. }
  100. function removeInterceptorHook(interceptor, option) {
  101. if (!interceptor || !option) {
  102. return;
  103. }
  104. Object.keys(option).forEach(function (hook) {
  105. if (HOOKS.indexOf(hook) !== -1 && isFn(option[hook])) {
  106. removeHook(interceptor[hook], option[hook]);
  107. }
  108. });
  109. }
  110. function addInterceptor(method, option) {
  111. if (typeof method === 'string' && isPlainObject(option)) {
  112. mergeInterceptorHook(scopedInterceptors[method] || (scopedInterceptors[method] = {}), option);
  113. } else if (isPlainObject(method)) {
  114. mergeInterceptorHook(globalInterceptors, method);
  115. }
  116. }
  117. function removeInterceptor(method, option) {
  118. if (typeof method === 'string') {
  119. if (isPlainObject(option)) {
  120. removeInterceptorHook(scopedInterceptors[method], option);
  121. } else {
  122. delete scopedInterceptors[method];
  123. }
  124. } else if (isPlainObject(method)) {
  125. removeInterceptorHook(globalInterceptors, method);
  126. }
  127. }
  128. function wrapperHook(hook) {
  129. return function (data) {
  130. return hook(data) || data;
  131. };
  132. }
  133. function isPromise(obj) {
  134. return !!obj && (typeof obj === 'object' || typeof obj === 'function') && typeof obj.then === 'function';
  135. }
  136. function queue(hooks, data) {
  137. var promise = false;
  138. for (var i = 0; i < hooks.length; i++) {
  139. var hook = hooks[i];
  140. if (promise) {
  141. promise = Promise.then(wrapperHook(hook));
  142. } else {
  143. var res = hook(data);
  144. if (isPromise(res)) {
  145. promise = Promise.resolve(res);
  146. }
  147. if (res === false) {
  148. return {
  149. then: function then() {} };
  150. }
  151. }
  152. }
  153. return promise || {
  154. then: function then(callback) {
  155. return callback(data);
  156. } };
  157. }
  158. function wrapperOptions(interceptor) {var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
  159. ['success', 'fail', 'complete'].forEach(function (name) {
  160. if (Array.isArray(interceptor[name])) {
  161. var oldCallback = options[name];
  162. options[name] = function callbackInterceptor(res) {
  163. queue(interceptor[name], res).then(function (res) {
  164. /* eslint-disable no-mixed-operators */
  165. return isFn(oldCallback) && oldCallback(res) || res;
  166. });
  167. };
  168. }
  169. });
  170. return options;
  171. }
  172. function wrapperReturnValue(method, returnValue) {
  173. var returnValueHooks = [];
  174. if (Array.isArray(globalInterceptors.returnValue)) {
  175. returnValueHooks.push.apply(returnValueHooks, _toConsumableArray(globalInterceptors.returnValue));
  176. }
  177. var interceptor = scopedInterceptors[method];
  178. if (interceptor && Array.isArray(interceptor.returnValue)) {
  179. returnValueHooks.push.apply(returnValueHooks, _toConsumableArray(interceptor.returnValue));
  180. }
  181. returnValueHooks.forEach(function (hook) {
  182. returnValue = hook(returnValue) || returnValue;
  183. });
  184. return returnValue;
  185. }
  186. function getApiInterceptorHooks(method) {
  187. var interceptor = Object.create(null);
  188. Object.keys(globalInterceptors).forEach(function (hook) {
  189. if (hook !== 'returnValue') {
  190. interceptor[hook] = globalInterceptors[hook].slice();
  191. }
  192. });
  193. var scopedInterceptor = scopedInterceptors[method];
  194. if (scopedInterceptor) {
  195. Object.keys(scopedInterceptor).forEach(function (hook) {
  196. if (hook !== 'returnValue') {
  197. interceptor[hook] = (interceptor[hook] || []).concat(scopedInterceptor[hook]);
  198. }
  199. });
  200. }
  201. return interceptor;
  202. }
  203. function invokeApi(method, api, options) {for (var _len = arguments.length, params = new Array(_len > 3 ? _len - 3 : 0), _key = 3; _key < _len; _key++) {params[_key - 3] = arguments[_key];}
  204. var interceptor = getApiInterceptorHooks(method);
  205. if (interceptor && Object.keys(interceptor).length) {
  206. if (Array.isArray(interceptor.invoke)) {
  207. var res = queue(interceptor.invoke, options);
  208. return res.then(function (options) {
  209. return api.apply(void 0, [wrapperOptions(interceptor, options)].concat(params));
  210. });
  211. } else {
  212. return api.apply(void 0, [wrapperOptions(interceptor, options)].concat(params));
  213. }
  214. }
  215. return api.apply(void 0, [options].concat(params));
  216. }
  217. var promiseInterceptor = {
  218. returnValue: function returnValue(res) {
  219. if (!isPromise(res)) {
  220. return res;
  221. }
  222. return res.then(function (res) {
  223. return res[1];
  224. }).catch(function (res) {
  225. return res[0];
  226. });
  227. } };
  228. var SYNC_API_RE =
  229. /^\$|interceptors|Interceptor$|getSubNVueById|requireNativePlugin|upx2px|hideKeyboard|canIUse|^create|Sync$|Manager$|base64ToArrayBuffer|arrayBufferToBase64/;
  230. var CONTEXT_API_RE = /^create|Manager$/;
  231. var CALLBACK_API_RE = /^on/;
  232. function isContextApi(name) {
  233. return CONTEXT_API_RE.test(name);
  234. }
  235. function isSyncApi(name) {
  236. return SYNC_API_RE.test(name);
  237. }
  238. function isCallbackApi(name) {
  239. return CALLBACK_API_RE.test(name);
  240. }
  241. function handlePromise(promise) {
  242. return promise.then(function (data) {
  243. return [null, data];
  244. }).
  245. catch(function (err) {return [err];});
  246. }
  247. function shouldPromise(name) {
  248. if (
  249. isContextApi(name) ||
  250. isSyncApi(name) ||
  251. isCallbackApi(name))
  252. {
  253. return false;
  254. }
  255. return true;
  256. }
  257. function promisify(name, api) {
  258. if (!shouldPromise(name)) {
  259. return api;
  260. }
  261. return function promiseApi() {var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};for (var _len2 = arguments.length, params = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {params[_key2 - 1] = arguments[_key2];}
  262. if (isFn(options.success) || isFn(options.fail) || isFn(options.complete)) {
  263. return wrapperReturnValue(name, invokeApi.apply(void 0, [name, api, options].concat(params)));
  264. }
  265. return wrapperReturnValue(name, handlePromise(new Promise(function (resolve, reject) {
  266. invokeApi.apply(void 0, [name, api, Object.assign({}, options, {
  267. success: resolve,
  268. fail: reject })].concat(
  269. params));
  270. /* eslint-disable no-extend-native */
  271. if (!Promise.prototype.finally) {
  272. Promise.prototype.finally = function (callback) {
  273. var promise = this.constructor;
  274. return this.then(
  275. function (value) {return promise.resolve(callback()).then(function () {return value;});},
  276. function (reason) {return promise.resolve(callback()).then(function () {
  277. throw reason;
  278. });});
  279. };
  280. }
  281. })));
  282. };
  283. }
  284. var EPS = 1e-4;
  285. var BASE_DEVICE_WIDTH = 750;
  286. var isIOS = false;
  287. var deviceWidth = 0;
  288. var deviceDPR = 0;
  289. function checkDeviceWidth() {var _wx$getSystemInfoSync =
  290. wx.getSystemInfoSync(),platform = _wx$getSystemInfoSync.platform,pixelRatio = _wx$getSystemInfoSync.pixelRatio,windowWidth = _wx$getSystemInfoSync.windowWidth; // uni=>wx runtime 编译目标是 uni 对象,内部不允许直接使用 uni
  291. deviceWidth = windowWidth;
  292. deviceDPR = pixelRatio;
  293. isIOS = platform === 'ios';
  294. }
  295. function upx2px(number, newDeviceWidth) {
  296. if (deviceWidth === 0) {
  297. checkDeviceWidth();
  298. }
  299. number = Number(number);
  300. if (number === 0) {
  301. return 0;
  302. }
  303. var result = number / BASE_DEVICE_WIDTH * (newDeviceWidth || deviceWidth);
  304. if (result < 0) {
  305. result = -result;
  306. }
  307. result = Math.floor(result + EPS);
  308. if (result === 0) {
  309. if (deviceDPR === 1 || !isIOS) {
  310. return 1;
  311. } else {
  312. return 0.5;
  313. }
  314. }
  315. return number < 0 ? -result : result;
  316. }
  317. var interceptors = {
  318. promiseInterceptor: promiseInterceptor };
  319. var baseApi = /*#__PURE__*/Object.freeze({
  320. upx2px: upx2px,
  321. interceptors: interceptors,
  322. addInterceptor: addInterceptor,
  323. removeInterceptor: removeInterceptor });
  324. var previewImage = {
  325. args: function args(fromArgs) {
  326. var currentIndex = parseInt(fromArgs.current);
  327. if (isNaN(currentIndex)) {
  328. return;
  329. }
  330. var urls = fromArgs.urls;
  331. if (!Array.isArray(urls)) {
  332. return;
  333. }
  334. var len = urls.length;
  335. if (!len) {
  336. return;
  337. }
  338. if (currentIndex < 0) {
  339. currentIndex = 0;
  340. } else if (currentIndex >= len) {
  341. currentIndex = len - 1;
  342. }
  343. if (currentIndex > 0) {
  344. fromArgs.current = urls[currentIndex];
  345. fromArgs.urls = urls.filter(
  346. function (item, index) {return index < currentIndex ? item !== urls[currentIndex] : true;});
  347. } else {
  348. fromArgs.current = urls[0];
  349. }
  350. return {
  351. indicator: false,
  352. loop: false };
  353. } };
  354. var protocols = {
  355. previewImage: previewImage };
  356. var todos = [];
  357. var canIUses = [];
  358. var CALLBACKS = ['success', 'fail', 'cancel', 'complete'];
  359. function processCallback(methodName, method, returnValue) {
  360. return function (res) {
  361. return method(processReturnValue(methodName, res, returnValue));
  362. };
  363. }
  364. function processArgs(methodName, fromArgs) {var argsOption = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};var returnValue = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};var keepFromArgs = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : false;
  365. if (isPlainObject(fromArgs)) {// 一般 api 的参数解析
  366. var toArgs = keepFromArgs === true ? fromArgs : {}; // returnValue 为 false 时,说明是格式化返回值,直接在返回值对象上修改赋值
  367. if (isFn(argsOption)) {
  368. argsOption = argsOption(fromArgs, toArgs) || {};
  369. }
  370. for (var key in fromArgs) {
  371. if (hasOwn(argsOption, key)) {
  372. var keyOption = argsOption[key];
  373. if (isFn(keyOption)) {
  374. keyOption = keyOption(fromArgs[key], fromArgs, toArgs);
  375. }
  376. if (!keyOption) {// 不支持的参数
  377. console.warn("\u5FAE\u4FE1\u5C0F\u7A0B\u5E8F ".concat(methodName, "\u6682\u4E0D\u652F\u6301").concat(key));
  378. } else if (isStr(keyOption)) {// 重写参数 key
  379. toArgs[keyOption] = fromArgs[key];
  380. } else if (isPlainObject(keyOption)) {// {name:newName,value:value}可重新指定参数 key:value
  381. toArgs[keyOption.name ? keyOption.name : key] = keyOption.value;
  382. }
  383. } else if (CALLBACKS.indexOf(key) !== -1) {
  384. toArgs[key] = processCallback(methodName, fromArgs[key], returnValue);
  385. } else {
  386. if (!keepFromArgs) {
  387. toArgs[key] = fromArgs[key];
  388. }
  389. }
  390. }
  391. return toArgs;
  392. } else if (isFn(fromArgs)) {
  393. fromArgs = processCallback(methodName, fromArgs, returnValue);
  394. }
  395. return fromArgs;
  396. }
  397. function processReturnValue(methodName, res, returnValue) {var keepReturnValue = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : false;
  398. if (isFn(protocols.returnValue)) {// 处理通用 returnValue
  399. res = protocols.returnValue(methodName, res);
  400. }
  401. return processArgs(methodName, res, returnValue, {}, keepReturnValue);
  402. }
  403. function wrapper(methodName, method) {
  404. if (hasOwn(protocols, methodName)) {
  405. var protocol = protocols[methodName];
  406. if (!protocol) {// 暂不支持的 api
  407. return function () {
  408. console.error("\u5FAE\u4FE1\u5C0F\u7A0B\u5E8F \u6682\u4E0D\u652F\u6301".concat(methodName));
  409. };
  410. }
  411. return function (arg1, arg2) {// 目前 api 最多两个参数
  412. var options = protocol;
  413. if (isFn(protocol)) {
  414. options = protocol(arg1);
  415. }
  416. arg1 = processArgs(methodName, arg1, options.args, options.returnValue);
  417. var args = [arg1];
  418. if (typeof arg2 !== 'undefined') {
  419. args.push(arg2);
  420. }
  421. var returnValue = wx[options.name || methodName].apply(wx, args);
  422. if (isSyncApi(methodName)) {// 同步 api
  423. return processReturnValue(methodName, returnValue, options.returnValue, isContextApi(methodName));
  424. }
  425. return returnValue;
  426. };
  427. }
  428. return method;
  429. }
  430. var todoApis = Object.create(null);
  431. var TODOS = [
  432. 'subscribePush',
  433. 'unsubscribePush',
  434. 'onPush',
  435. 'offPush',
  436. 'share'];
  437. function createTodoApi(name) {
  438. return function todoApi(_ref)
  439. {var fail = _ref.fail,complete = _ref.complete;
  440. var res = {
  441. errMsg: "".concat(name, ":fail:\u6682\u4E0D\u652F\u6301 ").concat(name, " \u65B9\u6CD5") };
  442. isFn(fail) && fail(res);
  443. isFn(complete) && complete(res);
  444. };
  445. }
  446. TODOS.forEach(function (name) {
  447. todoApis[name] = createTodoApi(name);
  448. });
  449. var providers = {
  450. oauth: ['weixin'],
  451. share: ['weixin'],
  452. payment: ['wxpay'],
  453. push: ['weixin'] };
  454. function getProvider(_ref2)
  455. {var service = _ref2.service,success = _ref2.success,fail = _ref2.fail,complete = _ref2.complete;
  456. var res = false;
  457. if (providers[service]) {
  458. res = {
  459. errMsg: 'getProvider:ok',
  460. service: service,
  461. provider: providers[service] };
  462. isFn(success) && success(res);
  463. } else {
  464. res = {
  465. errMsg: 'getProvider:fail:服务[' + service + ']不存在' };
  466. isFn(fail) && fail(res);
  467. }
  468. isFn(complete) && complete(res);
  469. }
  470. var extraApi = /*#__PURE__*/Object.freeze({
  471. getProvider: getProvider });
  472. var getEmitter = function () {
  473. if (typeof getUniEmitter === 'function') {
  474. /* eslint-disable no-undef */
  475. return getUniEmitter;
  476. }
  477. var Emitter;
  478. return function getUniEmitter() {
  479. if (!Emitter) {
  480. Emitter = new _vue.default();
  481. }
  482. return Emitter;
  483. };
  484. }();
  485. function apply(ctx, method, args) {
  486. return ctx[method].apply(ctx, args);
  487. }
  488. function $on() {
  489. return apply(getEmitter(), '$on', Array.prototype.slice.call(arguments));
  490. }
  491. function $off() {
  492. return apply(getEmitter(), '$off', Array.prototype.slice.call(arguments));
  493. }
  494. function $once() {
  495. return apply(getEmitter(), '$once', Array.prototype.slice.call(arguments));
  496. }
  497. function $emit() {
  498. return apply(getEmitter(), '$emit', Array.prototype.slice.call(arguments));
  499. }
  500. var eventApi = /*#__PURE__*/Object.freeze({
  501. $on: $on,
  502. $off: $off,
  503. $once: $once,
  504. $emit: $emit });
  505. var api = /*#__PURE__*/Object.freeze({});
  506. var MPPage = Page;
  507. var MPComponent = Component;
  508. var customizeRE = /:/g;
  509. var customize = cached(function (str) {
  510. return camelize(str.replace(customizeRE, '-'));
  511. });
  512. function initTriggerEvent(mpInstance) {
  513. {
  514. if (!wx.canIUse('nextTick')) {
  515. return;
  516. }
  517. }
  518. var oldTriggerEvent = mpInstance.triggerEvent;
  519. mpInstance.triggerEvent = function (event) {for (var _len3 = arguments.length, args = new Array(_len3 > 1 ? _len3 - 1 : 0), _key3 = 1; _key3 < _len3; _key3++) {args[_key3 - 1] = arguments[_key3];}
  520. return oldTriggerEvent.apply(mpInstance, [customize(event)].concat(args));
  521. };
  522. }
  523. function initHook(name, options) {
  524. var oldHook = options[name];
  525. if (!oldHook) {
  526. options[name] = function () {
  527. initTriggerEvent(this);
  528. };
  529. } else {
  530. options[name] = function () {
  531. initTriggerEvent(this);for (var _len4 = arguments.length, args = new Array(_len4), _key4 = 0; _key4 < _len4; _key4++) {args[_key4] = arguments[_key4];}
  532. return oldHook.apply(this, args);
  533. };
  534. }
  535. }
  536. Page = function Page() {var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
  537. initHook('onLoad', options);
  538. return MPPage(options);
  539. };
  540. Component = function Component() {var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
  541. initHook('created', options);
  542. return MPComponent(options);
  543. };
  544. var PAGE_EVENT_HOOKS = [
  545. 'onPullDownRefresh',
  546. 'onReachBottom',
  547. 'onShareAppMessage',
  548. 'onPageScroll',
  549. 'onResize',
  550. 'onTabItemTap'];
  551. function initMocks(vm, mocks) {
  552. var mpInstance = vm.$mp[vm.mpType];
  553. mocks.forEach(function (mock) {
  554. if (hasOwn(mpInstance, mock)) {
  555. vm[mock] = mpInstance[mock];
  556. }
  557. });
  558. }
  559. function hasHook(hook, vueOptions) {
  560. if (!vueOptions) {
  561. return true;
  562. }
  563. if (_vue.default.options && Array.isArray(_vue.default.options[hook])) {
  564. return true;
  565. }
  566. vueOptions = vueOptions.default || vueOptions;
  567. if (isFn(vueOptions)) {
  568. if (isFn(vueOptions.extendOptions[hook])) {
  569. return true;
  570. }
  571. if (vueOptions.super &&
  572. vueOptions.super.options &&
  573. Array.isArray(vueOptions.super.options[hook])) {
  574. return true;
  575. }
  576. return false;
  577. }
  578. if (isFn(vueOptions[hook])) {
  579. return true;
  580. }
  581. var mixins = vueOptions.mixins;
  582. if (Array.isArray(mixins)) {
  583. return !!mixins.find(function (mixin) {return hasHook(hook, mixin);});
  584. }
  585. }
  586. function initHooks(mpOptions, hooks, vueOptions) {
  587. hooks.forEach(function (hook) {
  588. if (hasHook(hook, vueOptions)) {
  589. mpOptions[hook] = function (args) {
  590. return this.$vm && this.$vm.__call_hook(hook, args);
  591. };
  592. }
  593. });
  594. }
  595. function initVueComponent(Vue, vueOptions) {
  596. vueOptions = vueOptions.default || vueOptions;
  597. var VueComponent;
  598. if (isFn(vueOptions)) {
  599. VueComponent = vueOptions;
  600. vueOptions = VueComponent.extendOptions;
  601. } else {
  602. VueComponent = Vue.extend(vueOptions);
  603. }
  604. return [VueComponent, vueOptions];
  605. }
  606. function initSlots(vm, vueSlots) {
  607. if (Array.isArray(vueSlots) && vueSlots.length) {
  608. var $slots = Object.create(null);
  609. vueSlots.forEach(function (slotName) {
  610. $slots[slotName] = true;
  611. });
  612. vm.$scopedSlots = vm.$slots = $slots;
  613. }
  614. }
  615. function initVueIds(vueIds, mpInstance) {
  616. vueIds = (vueIds || '').split(',');
  617. var len = vueIds.length;
  618. if (len === 1) {
  619. mpInstance._$vueId = vueIds[0];
  620. } else if (len === 2) {
  621. mpInstance._$vueId = vueIds[0];
  622. mpInstance._$vuePid = vueIds[1];
  623. }
  624. }
  625. function initData(vueOptions, context) {
  626. var data = vueOptions.data || {};
  627. var methods = vueOptions.methods || {};
  628. if (typeof data === 'function') {
  629. try {
  630. data = data.call(context); // 支持 Vue.prototype 上挂的数据
  631. } catch (e) {
  632. if (Object({"NODE_ENV":"development","VUE_APP_PLATFORM":"mp-weixin","BASE_URL":"/"}).VUE_APP_DEBUG) {
  633. console.warn('根据 Vue 的 data 函数初始化小程序 data 失败,请尽量确保 data 函数中不访问 vm 对象,否则可能影响首次数据渲染速度。', data);
  634. }
  635. }
  636. } else {
  637. try {
  638. // 对 data 格式化
  639. data = JSON.parse(JSON.stringify(data));
  640. } catch (e) {}
  641. }
  642. if (!isPlainObject(data)) {
  643. data = {};
  644. }
  645. Object.keys(methods).forEach(function (methodName) {
  646. if (context.__lifecycle_hooks__.indexOf(methodName) === -1 && !hasOwn(data, methodName)) {
  647. data[methodName] = methods[methodName];
  648. }
  649. });
  650. return data;
  651. }
  652. var PROP_TYPES = [String, Number, Boolean, Object, Array, null];
  653. function createObserver(name) {
  654. return function observer(newVal, oldVal) {
  655. if (this.$vm) {
  656. this.$vm[name] = newVal; // 为了触发其他非 render watcher
  657. }
  658. };
  659. }
  660. function initBehaviors(vueOptions, initBehavior) {
  661. var vueBehaviors = vueOptions['behaviors'];
  662. var vueExtends = vueOptions['extends'];
  663. var vueMixins = vueOptions['mixins'];
  664. var vueProps = vueOptions['props'];
  665. if (!vueProps) {
  666. vueOptions['props'] = vueProps = [];
  667. }
  668. var behaviors = [];
  669. if (Array.isArray(vueBehaviors)) {
  670. vueBehaviors.forEach(function (behavior) {
  671. behaviors.push(behavior.replace('uni://', "wx".concat("://")));
  672. if (behavior === 'uni://form-field') {
  673. if (Array.isArray(vueProps)) {
  674. vueProps.push('name');
  675. vueProps.push('value');
  676. } else {
  677. vueProps['name'] = {
  678. type: String,
  679. default: '' };
  680. vueProps['value'] = {
  681. type: [String, Number, Boolean, Array, Object, Date],
  682. default: '' };
  683. }
  684. }
  685. });
  686. }
  687. if (isPlainObject(vueExtends) && vueExtends.props) {
  688. behaviors.push(
  689. initBehavior({
  690. properties: initProperties(vueExtends.props, true) }));
  691. }
  692. if (Array.isArray(vueMixins)) {
  693. vueMixins.forEach(function (vueMixin) {
  694. if (isPlainObject(vueMixin) && vueMixin.props) {
  695. behaviors.push(
  696. initBehavior({
  697. properties: initProperties(vueMixin.props, true) }));
  698. }
  699. });
  700. }
  701. return behaviors;
  702. }
  703. function parsePropType(key, type, defaultValue, file) {
  704. // [String]=>String
  705. if (Array.isArray(type) && type.length === 1) {
  706. return type[0];
  707. }
  708. return type;
  709. }
  710. function initProperties(props) {var isBehavior = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;var file = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : '';
  711. var properties = {};
  712. if (!isBehavior) {
  713. properties.vueId = {
  714. type: String,
  715. value: '' };
  716. properties.vueSlots = { // 小程序不能直接定义 $slots 的 props,所以通过 vueSlots 转换到 $slots
  717. type: null,
  718. value: [],
  719. observer: function observer(newVal, oldVal) {
  720. var $slots = Object.create(null);
  721. newVal.forEach(function (slotName) {
  722. $slots[slotName] = true;
  723. });
  724. this.setData({
  725. $slots: $slots });
  726. } };
  727. }
  728. if (Array.isArray(props)) {// ['title']
  729. props.forEach(function (key) {
  730. properties[key] = {
  731. type: null,
  732. observer: createObserver(key) };
  733. });
  734. } else if (isPlainObject(props)) {// {title:{type:String,default:''},content:String}
  735. Object.keys(props).forEach(function (key) {
  736. var opts = props[key];
  737. if (isPlainObject(opts)) {// title:{type:String,default:''}
  738. var value = opts['default'];
  739. if (isFn(value)) {
  740. value = value();
  741. }
  742. opts.type = parsePropType(key, opts.type);
  743. properties[key] = {
  744. type: PROP_TYPES.indexOf(opts.type) !== -1 ? opts.type : null,
  745. value: value,
  746. observer: createObserver(key) };
  747. } else {// content:String
  748. var type = parsePropType(key, opts);
  749. properties[key] = {
  750. type: PROP_TYPES.indexOf(type) !== -1 ? type : null,
  751. observer: createObserver(key) };
  752. }
  753. });
  754. }
  755. return properties;
  756. }
  757. function wrapper$1(event) {
  758. // TODO 又得兼容 mpvue 的 mp 对象
  759. try {
  760. event.mp = JSON.parse(JSON.stringify(event));
  761. } catch (e) {}
  762. event.stopPropagation = noop;
  763. event.preventDefault = noop;
  764. event.target = event.target || {};
  765. if (!hasOwn(event, 'detail')) {
  766. event.detail = {};
  767. }
  768. if (isPlainObject(event.detail)) {
  769. event.target = Object.assign({}, event.target, event.detail);
  770. }
  771. return event;
  772. }
  773. function getExtraValue(vm, dataPathsArray) {
  774. var context = vm;
  775. dataPathsArray.forEach(function (dataPathArray) {
  776. var dataPath = dataPathArray[0];
  777. var value = dataPathArray[2];
  778. if (dataPath || typeof value !== 'undefined') {// ['','',index,'disable']
  779. var propPath = dataPathArray[1];
  780. var valuePath = dataPathArray[3];
  781. var vFor = dataPath ? vm.__get_value(dataPath, context) : context;
  782. if (Number.isInteger(vFor)) {
  783. context = value;
  784. } else if (!propPath) {
  785. context = vFor[value];
  786. } else {
  787. if (Array.isArray(vFor)) {
  788. context = vFor.find(function (vForItem) {
  789. return vm.__get_value(propPath, vForItem) === value;
  790. });
  791. } else if (isPlainObject(vFor)) {
  792. context = Object.keys(vFor).find(function (vForKey) {
  793. return vm.__get_value(propPath, vFor[vForKey]) === value;
  794. });
  795. } else {
  796. console.error('v-for 暂不支持循环数据:', vFor);
  797. }
  798. }
  799. if (valuePath) {
  800. context = vm.__get_value(valuePath, context);
  801. }
  802. }
  803. });
  804. return context;
  805. }
  806. function processEventExtra(vm, extra, event) {
  807. var extraObj = {};
  808. if (Array.isArray(extra) && extra.length) {
  809. /**
  810. *[
  811. * ['data.items', 'data.id', item.data.id],
  812. * ['metas', 'id', meta.id]
  813. *],
  814. *[
  815. * ['data.items', 'data.id', item.data.id],
  816. * ['metas', 'id', meta.id]
  817. *],
  818. *'test'
  819. */
  820. extra.forEach(function (dataPath, index) {
  821. if (typeof dataPath === 'string') {
  822. if (!dataPath) {// model,prop.sync
  823. extraObj['$' + index] = vm;
  824. } else {
  825. if (dataPath === '$event') {// $event
  826. extraObj['$' + index] = event;
  827. } else if (dataPath.indexOf('$event.') === 0) {// $event.target.value
  828. extraObj['$' + index] = vm.__get_value(dataPath.replace('$event.', ''), event);
  829. } else {
  830. extraObj['$' + index] = vm.__get_value(dataPath);
  831. }
  832. }
  833. } else {
  834. extraObj['$' + index] = getExtraValue(vm, dataPath);
  835. }
  836. });
  837. }
  838. return extraObj;
  839. }
  840. function getObjByArray(arr) {
  841. var obj = {};
  842. for (var i = 1; i < arr.length; i++) {
  843. var element = arr[i];
  844. obj[element[0]] = element[1];
  845. }
  846. return obj;
  847. }
  848. function processEventArgs(vm, event) {var args = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : [];var extra = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : [];var isCustom = arguments.length > 4 ? arguments[4] : undefined;var methodName = arguments.length > 5 ? arguments[5] : undefined;
  849. var isCustomMPEvent = false; // wxcomponent 组件,传递原始 event 对象
  850. if (isCustom) {// 自定义事件
  851. isCustomMPEvent = event.currentTarget &&
  852. event.currentTarget.dataset &&
  853. event.currentTarget.dataset.comType === 'wx';
  854. if (!args.length) {// 无参数,直接传入 event 或 detail 数组
  855. if (isCustomMPEvent) {
  856. return [event];
  857. }
  858. return event.detail.__args__ || event.detail;
  859. }
  860. }
  861. var extraObj = processEventExtra(vm, extra, event);
  862. var ret = [];
  863. args.forEach(function (arg) {
  864. if (arg === '$event') {
  865. if (methodName === '__set_model' && !isCustom) {// input v-model value
  866. ret.push(event.target.value);
  867. } else {
  868. if (isCustom && !isCustomMPEvent) {
  869. ret.push(event.detail.__args__[0]);
  870. } else {// wxcomponent 组件或内置组件
  871. ret.push(event);
  872. }
  873. }
  874. } else {
  875. if (Array.isArray(arg) && arg[0] === 'o') {
  876. ret.push(getObjByArray(arg));
  877. } else if (typeof arg === 'string' && hasOwn(extraObj, arg)) {
  878. ret.push(extraObj[arg]);
  879. } else {
  880. ret.push(arg);
  881. }
  882. }
  883. });
  884. return ret;
  885. }
  886. var ONCE = '~';
  887. var CUSTOM = '^';
  888. function isMatchEventType(eventType, optType) {
  889. return eventType === optType ||
  890. optType === 'regionchange' && (
  891. eventType === 'begin' ||
  892. eventType === 'end');
  893. }
  894. function handleEvent(event) {var _this = this;
  895. event = wrapper$1(event);
  896. // [['tap',[['handle',[1,2,a]],['handle1',[1,2,a]]]]]
  897. var dataset = (event.currentTarget || event.target).dataset;
  898. if (!dataset) {
  899. return console.warn("\u4E8B\u4EF6\u4FE1\u606F\u4E0D\u5B58\u5728");
  900. }
  901. var eventOpts = dataset.eventOpts || dataset['event-opts']; // 支付宝 web-view 组件 dataset 非驼峰
  902. if (!eventOpts) {
  903. return console.warn("\u4E8B\u4EF6\u4FE1\u606F\u4E0D\u5B58\u5728");
  904. }
  905. // [['handle',[1,2,a]],['handle1',[1,2,a]]]
  906. var eventType = event.type;
  907. var ret = [];
  908. eventOpts.forEach(function (eventOpt) {
  909. var type = eventOpt[0];
  910. var eventsArray = eventOpt[1];
  911. var isCustom = type.charAt(0) === CUSTOM;
  912. type = isCustom ? type.slice(1) : type;
  913. var isOnce = type.charAt(0) === ONCE;
  914. type = isOnce ? type.slice(1) : type;
  915. if (eventsArray && isMatchEventType(eventType, type)) {
  916. eventsArray.forEach(function (eventArray) {
  917. var methodName = eventArray[0];
  918. if (methodName) {
  919. var handlerCtx = _this.$vm;
  920. if (
  921. handlerCtx.$options.generic &&
  922. handlerCtx.$parent &&
  923. handlerCtx.$parent.$parent)
  924. {// mp-weixin,mp-toutiao 抽象节点模拟 scoped slots
  925. handlerCtx = handlerCtx.$parent.$parent;
  926. }
  927. var handler = handlerCtx[methodName];
  928. if (!isFn(handler)) {
  929. throw new Error(" _vm.".concat(methodName, " is not a function"));
  930. }
  931. if (isOnce) {
  932. if (handler.once) {
  933. return;
  934. }
  935. handler.once = true;
  936. }
  937. ret.push(handler.apply(handlerCtx, processEventArgs(
  938. _this.$vm,
  939. event,
  940. eventArray[1],
  941. eventArray[2],
  942. isCustom,
  943. methodName)));
  944. }
  945. });
  946. }
  947. });
  948. if (
  949. eventType === 'input' &&
  950. ret.length === 1 &&
  951. typeof ret[0] !== 'undefined')
  952. {
  953. return ret[0];
  954. }
  955. }
  956. var hooks = [
  957. 'onShow',
  958. 'onHide',
  959. 'onError',
  960. 'onPageNotFound'];
  961. function parseBaseApp(vm, _ref3)
  962. {var mocks = _ref3.mocks,initRefs = _ref3.initRefs;
  963. _vue.default.prototype.mpHost = "mp-weixin";
  964. _vue.default.mixin({
  965. beforeCreate: function beforeCreate() {
  966. if (!this.$options.mpType) {
  967. return;
  968. }
  969. this.mpType = this.$options.mpType;
  970. this.$mp = _defineProperty({
  971. data: {} },
  972. this.mpType, this.$options.mpInstance);
  973. this.$scope = this.$options.mpInstance;
  974. delete this.$options.mpType;
  975. delete this.$options.mpInstance;
  976. if (this.mpType !== 'app') {
  977. initRefs(this);
  978. initMocks(this, mocks);
  979. }
  980. } });
  981. var appOptions = {
  982. onLaunch: function onLaunch(args) {
  983. if (this.$vm) {// 已经初始化过了,主要是为了百度,百度 onShow 在 onLaunch 之前
  984. return;
  985. }
  986. {
  987. if (!wx.canIUse('nextTick')) {// 事实 上2.2.3 即可,简单使用 2.3.0 的 nextTick 判断
  988. console.error('当前微信基础库版本过低,请将 微信开发者工具-详情-项目设置-调试基础库版本 更换为`2.3.0`以上');
  989. }
  990. }
  991. this.$vm = vm;
  992. this.$vm.$mp = {
  993. app: this };
  994. this.$vm.$scope = this;
  995. this.$vm._isMounted = true;
  996. this.$vm.__call_hook('mounted', args);
  997. this.$vm.__call_hook('onLaunch', args);
  998. } };
  999. // 兼容旧版本 globalData
  1000. appOptions.globalData = vm.$options.globalData || {};
  1001. initHooks(appOptions, hooks);
  1002. return appOptions;
  1003. }
  1004. var mocks = ['__route__', '__wxExparserNodeId__', '__wxWebviewId__'];
  1005. function findVmByVueId(vm, vuePid) {
  1006. var $children = vm.$children;
  1007. // 优先查找直属
  1008. var parentVm = $children.find(function (childVm) {return childVm.$scope._$vueId === vuePid;});
  1009. if (parentVm) {
  1010. return parentVm;
  1011. }
  1012. // 反向递归查找
  1013. for (var i = $children.length - 1; i >= 0; i--) {
  1014. parentVm = findVmByVueId($children[i], vuePid);
  1015. if (parentVm) {
  1016. return parentVm;
  1017. }
  1018. }
  1019. }
  1020. function initBehavior(options) {
  1021. return Behavior(options);
  1022. }
  1023. function isPage() {
  1024. return !!this.route;
  1025. }
  1026. function initRelation(detail) {
  1027. this.triggerEvent('__l', detail);
  1028. }
  1029. function initRefs(vm) {
  1030. var mpInstance = vm.$scope;
  1031. Object.defineProperty(vm, '$refs', {
  1032. get: function get() {
  1033. var $refs = {};
  1034. var components = mpInstance.selectAllComponents('.vue-ref');
  1035. components.forEach(function (component) {
  1036. var ref = component.dataset.ref;
  1037. $refs[ref] = component.$vm || component;
  1038. });
  1039. var forComponents = mpInstance.selectAllComponents('.vue-ref-in-for');
  1040. forComponents.forEach(function (component) {
  1041. var ref = component.dataset.ref;
  1042. if (!$refs[ref]) {
  1043. $refs[ref] = [];
  1044. }
  1045. $refs[ref].push(component.$vm || component);
  1046. });
  1047. return $refs;
  1048. } });
  1049. }
  1050. function handleLink(event) {var _ref4 =
  1051. event.detail || event.value,vuePid = _ref4.vuePid,vueOptions = _ref4.vueOptions; // detail 是微信,value 是百度(dipatch)
  1052. var parentVm;
  1053. if (vuePid) {
  1054. parentVm = findVmByVueId(this.$vm, vuePid);
  1055. }
  1056. if (!parentVm) {
  1057. parentVm = this.$vm;
  1058. }
  1059. vueOptions.parent = parentVm;
  1060. }
  1061. function parseApp(vm) {
  1062. return parseBaseApp(vm, {
  1063. mocks: mocks,
  1064. initRefs: initRefs });
  1065. }
  1066. function createApp(vm) {
  1067. App(parseApp(vm));
  1068. return vm;
  1069. }
  1070. function parseBaseComponent(vueComponentOptions)
  1071. {var _ref5 = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {},isPage = _ref5.isPage,initRelation = _ref5.initRelation;var _initVueComponent =
  1072. initVueComponent(_vue.default, vueComponentOptions),_initVueComponent2 = _slicedToArray(_initVueComponent, 2),VueComponent = _initVueComponent2[0],vueOptions = _initVueComponent2[1];
  1073. var componentOptions = {
  1074. options: {
  1075. multipleSlots: true,
  1076. addGlobalClass: true },
  1077. data: initData(vueOptions, _vue.default.prototype),
  1078. behaviors: initBehaviors(vueOptions, initBehavior),
  1079. properties: initProperties(vueOptions.props, false, vueOptions.__file),
  1080. lifetimes: {
  1081. attached: function attached() {
  1082. var properties = this.properties;
  1083. var options = {
  1084. mpType: isPage.call(this) ? 'page' : 'component',
  1085. mpInstance: this,
  1086. propsData: properties };
  1087. initVueIds(properties.vueId, this);
  1088. // 处理父子关系
  1089. initRelation.call(this, {
  1090. vuePid: this._$vuePid,
  1091. vueOptions: options });
  1092. // 初始化 vue 实例
  1093. this.$vm = new VueComponent(options);
  1094. // 处理$slots,$scopedSlots(暂不支持动态变化$slots)
  1095. initSlots(this.$vm, properties.vueSlots);
  1096. // 触发首次 setData
  1097. this.$vm.$mount();
  1098. },
  1099. ready: function ready() {
  1100. // 当组件 props 默认值为 true,初始化时传入 false 会导致 created,ready 触发, 但 attached 不触发
  1101. // https://developers.weixin.qq.com/community/develop/doc/00066ae2844cc0f8eb883e2a557800
  1102. if (this.$vm) {
  1103. this.$vm._isMounted = true;
  1104. this.$vm.__call_hook('mounted');
  1105. this.$vm.__call_hook('onReady');
  1106. }
  1107. },
  1108. detached: function detached() {
  1109. this.$vm.$destroy();
  1110. } },
  1111. pageLifetimes: {
  1112. show: function show(args) {
  1113. this.$vm && this.$vm.__call_hook('onPageShow', args);
  1114. },
  1115. hide: function hide() {
  1116. this.$vm && this.$vm.__call_hook('onPageHide');
  1117. },
  1118. resize: function resize(size) {
  1119. this.$vm && this.$vm.__call_hook('onPageResize', size);
  1120. } },
  1121. methods: {
  1122. __l: handleLink,
  1123. __e: handleEvent } };
  1124. if (isPage) {
  1125. return componentOptions;
  1126. }
  1127. return [componentOptions, VueComponent];
  1128. }
  1129. function parseComponent(vueComponentOptions) {
  1130. return parseBaseComponent(vueComponentOptions, {
  1131. isPage: isPage,
  1132. initRelation: initRelation });
  1133. }
  1134. var hooks$1 = [
  1135. 'onShow',
  1136. 'onHide',
  1137. 'onUnload'];
  1138. hooks$1.push.apply(hooks$1, PAGE_EVENT_HOOKS);
  1139. function parseBasePage(vuePageOptions, _ref6)
  1140. {var isPage = _ref6.isPage,initRelation = _ref6.initRelation;
  1141. var pageOptions = parseComponent(vuePageOptions);
  1142. initHooks(pageOptions.methods, hooks$1, vuePageOptions);
  1143. pageOptions.methods.onLoad = function (args) {
  1144. this.$vm.$mp.query = args; // 兼容 mpvue
  1145. this.$vm.__call_hook('onLoad', args);
  1146. };
  1147. return pageOptions;
  1148. }
  1149. function parsePage(vuePageOptions) {
  1150. return parseBasePage(vuePageOptions, {
  1151. isPage: isPage,
  1152. initRelation: initRelation });
  1153. }
  1154. function createPage(vuePageOptions) {
  1155. {
  1156. return Component(parsePage(vuePageOptions));
  1157. }
  1158. }
  1159. function createComponent(vueOptions) {
  1160. {
  1161. return Component(parseComponent(vueOptions));
  1162. }
  1163. }
  1164. todos.forEach(function (todoApi) {
  1165. protocols[todoApi] = false;
  1166. });
  1167. canIUses.forEach(function (canIUseApi) {
  1168. var apiName = protocols[canIUseApi] && protocols[canIUseApi].name ? protocols[canIUseApi].name :
  1169. canIUseApi;
  1170. if (!wx.canIUse(apiName)) {
  1171. protocols[canIUseApi] = false;
  1172. }
  1173. });
  1174. var uni = {};
  1175. if (typeof Proxy !== 'undefined' && "mp-weixin" !== 'app-plus') {
  1176. uni = new Proxy({}, {
  1177. get: function get(target, name) {
  1178. if (baseApi[name]) {
  1179. return baseApi[name];
  1180. }
  1181. if (api[name]) {
  1182. return promisify(name, api[name]);
  1183. }
  1184. {
  1185. if (extraApi[name]) {
  1186. return promisify(name, extraApi[name]);
  1187. }
  1188. if (todoApis[name]) {
  1189. return promisify(name, todoApis[name]);
  1190. }
  1191. }
  1192. if (eventApi[name]) {
  1193. return eventApi[name];
  1194. }
  1195. if (!hasOwn(wx, name) && !hasOwn(protocols, name)) {
  1196. return;
  1197. }
  1198. return promisify(name, wrapper(name, wx[name]));
  1199. } });
  1200. } else {
  1201. Object.keys(baseApi).forEach(function (name) {
  1202. uni[name] = baseApi[name];
  1203. });
  1204. {
  1205. Object.keys(todoApis).forEach(function (name) {
  1206. uni[name] = promisify(name, todoApis[name]);
  1207. });
  1208. Object.keys(extraApi).forEach(function (name) {
  1209. uni[name] = promisify(name, todoApis[name]);
  1210. });
  1211. }
  1212. Object.keys(eventApi).forEach(function (name) {
  1213. uni[name] = eventApi[name];
  1214. });
  1215. Object.keys(api).forEach(function (name) {
  1216. uni[name] = promisify(name, api[name]);
  1217. });
  1218. Object.keys(wx).forEach(function (name) {
  1219. if (hasOwn(wx, name) || hasOwn(protocols, name)) {
  1220. uni[name] = promisify(name, wrapper(name, wx[name]));
  1221. }
  1222. });
  1223. }
  1224. wx.createApp = createApp;
  1225. wx.createPage = createPage;
  1226. wx.createComponent = createComponent;
  1227. var uni$1 = uni;var _default =
  1228. uni$1;exports.default = _default;
  1229. /***/ }),
  1230. /* 2 */
  1231. /*!******************************************************************************************!*\
  1232. !*** ./node_modules/@dcloudio/vue-cli-plugin-uni/packages/mp-vue/dist/mp.runtime.esm.js ***!
  1233. \******************************************************************************************/
  1234. /*! exports provided: default */
  1235. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  1236. "use strict";
  1237. __webpack_require__.r(__webpack_exports__);
  1238. /* WEBPACK VAR INJECTION */(function(global) {/*!
  1239. * Vue.js v2.6.10
  1240. * (c) 2014-2019 Evan You
  1241. * Released under the MIT License.
  1242. */
  1243. /* */
  1244. var emptyObject = Object.freeze({});
  1245. // These helpers produce better VM code in JS engines due to their
  1246. // explicitness and function inlining.
  1247. function isUndef (v) {
  1248. return v === undefined || v === null
  1249. }
  1250. function isDef (v) {
  1251. return v !== undefined && v !== null
  1252. }
  1253. function isTrue (v) {
  1254. return v === true
  1255. }
  1256. function isFalse (v) {
  1257. return v === false
  1258. }
  1259. /**
  1260. * Check if value is primitive.
  1261. */
  1262. function isPrimitive (value) {
  1263. return (
  1264. typeof value === 'string' ||
  1265. typeof value === 'number' ||
  1266. // $flow-disable-line
  1267. typeof value === 'symbol' ||
  1268. typeof value === 'boolean'
  1269. )
  1270. }
  1271. /**
  1272. * Quick object check - this is primarily used to tell
  1273. * Objects from primitive values when we know the value
  1274. * is a JSON-compliant type.
  1275. */
  1276. function isObject (obj) {
  1277. return obj !== null && typeof obj === 'object'
  1278. }
  1279. /**
  1280. * Get the raw type string of a value, e.g., [object Object].
  1281. */
  1282. var _toString = Object.prototype.toString;
  1283. function toRawType (value) {
  1284. return _toString.call(value).slice(8, -1)
  1285. }
  1286. /**
  1287. * Strict object type check. Only returns true
  1288. * for plain JavaScript objects.
  1289. */
  1290. function isPlainObject (obj) {
  1291. return _toString.call(obj) === '[object Object]'
  1292. }
  1293. function isRegExp (v) {
  1294. return _toString.call(v) === '[object RegExp]'
  1295. }
  1296. /**
  1297. * Check if val is a valid array index.
  1298. */
  1299. function isValidArrayIndex (val) {
  1300. var n = parseFloat(String(val));
  1301. return n >= 0 && Math.floor(n) === n && isFinite(val)
  1302. }
  1303. function isPromise (val) {
  1304. return (
  1305. isDef(val) &&
  1306. typeof val.then === 'function' &&
  1307. typeof val.catch === 'function'
  1308. )
  1309. }
  1310. /**
  1311. * Convert a value to a string that is actually rendered.
  1312. */
  1313. function toString (val) {
  1314. return val == null
  1315. ? ''
  1316. : Array.isArray(val) || (isPlainObject(val) && val.toString === _toString)
  1317. ? JSON.stringify(val, null, 2)
  1318. : String(val)
  1319. }
  1320. /**
  1321. * Convert an input value to a number for persistence.
  1322. * If the conversion fails, return original string.
  1323. */
  1324. function toNumber (val) {
  1325. var n = parseFloat(val);
  1326. return isNaN(n) ? val : n
  1327. }
  1328. /**
  1329. * Make a map and return a function for checking if a key
  1330. * is in that map.
  1331. */
  1332. function makeMap (
  1333. str,
  1334. expectsLowerCase
  1335. ) {
  1336. var map = Object.create(null);
  1337. var list = str.split(',');
  1338. for (var i = 0; i < list.length; i++) {
  1339. map[list[i]] = true;
  1340. }
  1341. return expectsLowerCase
  1342. ? function (val) { return map[val.toLowerCase()]; }
  1343. : function (val) { return map[val]; }
  1344. }
  1345. /**
  1346. * Check if a tag is a built-in tag.
  1347. */
  1348. var isBuiltInTag = makeMap('slot,component', true);
  1349. /**
  1350. * Check if an attribute is a reserved attribute.
  1351. */
  1352. var isReservedAttribute = makeMap('key,ref,slot,slot-scope,is');
  1353. /**
  1354. * Remove an item from an array.
  1355. */
  1356. function remove (arr, item) {
  1357. if (arr.length) {
  1358. var index = arr.indexOf(item);
  1359. if (index > -1) {
  1360. return arr.splice(index, 1)
  1361. }
  1362. }
  1363. }
  1364. /**
  1365. * Check whether an object has the property.
  1366. */
  1367. var hasOwnProperty = Object.prototype.hasOwnProperty;
  1368. function hasOwn (obj, key) {
  1369. return hasOwnProperty.call(obj, key)
  1370. }
  1371. /**
  1372. * Create a cached version of a pure function.
  1373. */
  1374. function cached (fn) {
  1375. var cache = Object.create(null);
  1376. return (function cachedFn (str) {
  1377. var hit = cache[str];
  1378. return hit || (cache[str] = fn(str))
  1379. })
  1380. }
  1381. /**
  1382. * Camelize a hyphen-delimited string.
  1383. */
  1384. var camelizeRE = /-(\w)/g;
  1385. var camelize = cached(function (str) {
  1386. return str.replace(camelizeRE, function (_, c) { return c ? c.toUpperCase() : ''; })
  1387. });
  1388. /**
  1389. * Capitalize a string.
  1390. */
  1391. var capitalize = cached(function (str) {
  1392. return str.charAt(0).toUpperCase() + str.slice(1)
  1393. });
  1394. /**
  1395. * Hyphenate a camelCase string.
  1396. */
  1397. var hyphenateRE = /\B([A-Z])/g;
  1398. var hyphenate = cached(function (str) {
  1399. return str.replace(hyphenateRE, '-$1').toLowerCase()
  1400. });
  1401. /**
  1402. * Simple bind polyfill for environments that do not support it,
  1403. * e.g., PhantomJS 1.x. Technically, we don't need this anymore
  1404. * since native bind is now performant enough in most browsers.
  1405. * But removing it would mean breaking code that was able to run in
  1406. * PhantomJS 1.x, so this must be kept for backward compatibility.
  1407. */
  1408. /* istanbul ignore next */
  1409. function polyfillBind (fn, ctx) {
  1410. function boundFn (a) {
  1411. var l = arguments.length;
  1412. return l
  1413. ? l > 1
  1414. ? fn.apply(ctx, arguments)
  1415. : fn.call(ctx, a)
  1416. : fn.call(ctx)
  1417. }
  1418. boundFn._length = fn.length;
  1419. return boundFn
  1420. }
  1421. function nativeBind (fn, ctx) {
  1422. return fn.bind(ctx)
  1423. }
  1424. var bind = Function.prototype.bind
  1425. ? nativeBind
  1426. : polyfillBind;
  1427. /**
  1428. * Convert an Array-like object to a real Array.
  1429. */
  1430. function toArray (list, start) {
  1431. start = start || 0;
  1432. var i = list.length - start;
  1433. var ret = new Array(i);
  1434. while (i--) {
  1435. ret[i] = list[i + start];
  1436. }
  1437. return ret
  1438. }
  1439. /**
  1440. * Mix properties into target object.
  1441. */
  1442. function extend (to, _from) {
  1443. for (var key in _from) {
  1444. to[key] = _from[key];
  1445. }
  1446. return to
  1447. }
  1448. /**
  1449. * Merge an Array of Objects into a single Object.
  1450. */
  1451. function toObject (arr) {
  1452. var res = {};
  1453. for (var i = 0; i < arr.length; i++) {
  1454. if (arr[i]) {
  1455. extend(res, arr[i]);
  1456. }
  1457. }
  1458. return res
  1459. }
  1460. /* eslint-disable no-unused-vars */
  1461. /**
  1462. * Perform no operation.
  1463. * Stubbing args to make Flow happy without leaving useless transpiled code
  1464. * with ...rest (https://flow.org/blog/2017/05/07/Strict-Function-Call-Arity/).
  1465. */
  1466. function noop (a, b, c) {}
  1467. /**
  1468. * Always return false.
  1469. */
  1470. var no = function (a, b, c) { return false; };
  1471. /* eslint-enable no-unused-vars */
  1472. /**
  1473. * Return the same value.
  1474. */
  1475. var identity = function (_) { return _; };
  1476. /**
  1477. * Check if two values are loosely equal - that is,
  1478. * if they are plain objects, do they have the same shape?
  1479. */
  1480. function looseEqual (a, b) {
  1481. if (a === b) { return true }
  1482. var isObjectA = isObject(a);
  1483. var isObjectB = isObject(b);
  1484. if (isObjectA && isObjectB) {
  1485. try {
  1486. var isArrayA = Array.isArray(a);
  1487. var isArrayB = Array.isArray(b);
  1488. if (isArrayA && isArrayB) {
  1489. return a.length === b.length && a.every(function (e, i) {
  1490. return looseEqual(e, b[i])
  1491. })
  1492. } else if (a instanceof Date && b instanceof Date) {
  1493. return a.getTime() === b.getTime()
  1494. } else if (!isArrayA && !isArrayB) {
  1495. var keysA = Object.keys(a);
  1496. var keysB = Object.keys(b);
  1497. return keysA.length === keysB.length && keysA.every(function (key) {
  1498. return looseEqual(a[key], b[key])
  1499. })
  1500. } else {
  1501. /* istanbul ignore next */
  1502. return false
  1503. }
  1504. } catch (e) {
  1505. /* istanbul ignore next */
  1506. return false
  1507. }
  1508. } else if (!isObjectA && !isObjectB) {
  1509. return String(a) === String(b)
  1510. } else {
  1511. return false
  1512. }
  1513. }
  1514. /**
  1515. * Return the first index at which a loosely equal value can be
  1516. * found in the array (if value is a plain object, the array must
  1517. * contain an object of the same shape), or -1 if it is not present.
  1518. */
  1519. function looseIndexOf (arr, val) {
  1520. for (var i = 0; i < arr.length; i++) {
  1521. if (looseEqual(arr[i], val)) { return i }
  1522. }
  1523. return -1
  1524. }
  1525. /**
  1526. * Ensure a function is called only once.
  1527. */
  1528. function once (fn) {
  1529. var called = false;
  1530. return function () {
  1531. if (!called) {
  1532. called = true;
  1533. fn.apply(this, arguments);
  1534. }
  1535. }
  1536. }
  1537. var ASSET_TYPES = [
  1538. 'component',
  1539. 'directive',
  1540. 'filter'
  1541. ];
  1542. var LIFECYCLE_HOOKS = [
  1543. 'beforeCreate',
  1544. 'created',
  1545. 'beforeMount',
  1546. 'mounted',
  1547. 'beforeUpdate',
  1548. 'updated',
  1549. 'beforeDestroy',
  1550. 'destroyed',
  1551. 'activated',
  1552. 'deactivated',
  1553. 'errorCaptured',
  1554. 'serverPrefetch'
  1555. ];
  1556. /* */
  1557. var config = ({
  1558. /**
  1559. * Option merge strategies (used in core/util/options)
  1560. */
  1561. // $flow-disable-line
  1562. optionMergeStrategies: Object.create(null),
  1563. /**
  1564. * Whether to suppress warnings.
  1565. */
  1566. silent: false,
  1567. /**
  1568. * Show production mode tip message on boot?
  1569. */
  1570. productionTip: "development" !== 'production',
  1571. /**
  1572. * Whether to enable devtools
  1573. */
  1574. devtools: "development" !== 'production',
  1575. /**
  1576. * Whether to record perf
  1577. */
  1578. performance: false,
  1579. /**
  1580. * Error handler for watcher errors
  1581. */
  1582. errorHandler: null,
  1583. /**
  1584. * Warn handler for watcher warns
  1585. */
  1586. warnHandler: null,
  1587. /**
  1588. * Ignore certain custom elements
  1589. */
  1590. ignoredElements: [],
  1591. /**
  1592. * Custom user key aliases for v-on
  1593. */
  1594. // $flow-disable-line
  1595. keyCodes: Object.create(null),
  1596. /**
  1597. * Check if a tag is reserved so that it cannot be registered as a
  1598. * component. This is platform-dependent and may be overwritten.
  1599. */
  1600. isReservedTag: no,
  1601. /**
  1602. * Check if an attribute is reserved so that it cannot be used as a component
  1603. * prop. This is platform-dependent and may be overwritten.
  1604. */
  1605. isReservedAttr: no,
  1606. /**
  1607. * Check if a tag is an unknown element.
  1608. * Platform-dependent.
  1609. */
  1610. isUnknownElement: no,
  1611. /**
  1612. * Get the namespace of an element
  1613. */
  1614. getTagNamespace: noop,
  1615. /**
  1616. * Parse the real tag name for the specific platform.
  1617. */
  1618. parsePlatformTagName: identity,
  1619. /**
  1620. * Check if an attribute must be bound using property, e.g. value
  1621. * Platform-dependent.
  1622. */
  1623. mustUseProp: no,
  1624. /**
  1625. * Perform updates asynchronously. Intended to be used by Vue Test Utils
  1626. * This will significantly reduce performance if set to false.
  1627. */
  1628. async: true,
  1629. /**
  1630. * Exposed for legacy reasons
  1631. */
  1632. _lifecycleHooks: LIFECYCLE_HOOKS
  1633. });
  1634. /* */
  1635. /**
  1636. * unicode letters used for parsing html tags, component names and property paths.
  1637. * using https://www.w3.org/TR/html53/semantics-scripting.html#potentialcustomelementname
  1638. * skipping \u10000-\uEFFFF due to it freezing up PhantomJS
  1639. */
  1640. var unicodeRegExp = /a-zA-Z\u00B7\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u037D\u037F-\u1FFF\u200C-\u200D\u203F-\u2040\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD/;
  1641. /**
  1642. * Check if a string starts with $ or _
  1643. */
  1644. function isReserved (str) {
  1645. var c = (str + '').charCodeAt(0);
  1646. return c === 0x24 || c === 0x5F
  1647. }
  1648. /**
  1649. * Define a property.
  1650. */
  1651. function def (obj, key, val, enumerable) {
  1652. Object.defineProperty(obj, key, {
  1653. value: val,
  1654. enumerable: !!enumerable,
  1655. writable: true,
  1656. configurable: true
  1657. });
  1658. }
  1659. /**
  1660. * Parse simple path.
  1661. */
  1662. var bailRE = new RegExp(("[^" + (unicodeRegExp.source) + ".$_\\d]"));
  1663. function parsePath (path) {
  1664. if (bailRE.test(path)) {
  1665. return
  1666. }
  1667. var segments = path.split('.');
  1668. return function (obj) {
  1669. for (var i = 0; i < segments.length; i++) {
  1670. if (!obj) { return }
  1671. obj = obj[segments[i]];
  1672. }
  1673. return obj
  1674. }
  1675. }
  1676. /* */
  1677. // can we use __proto__?
  1678. var hasProto = '__proto__' in {};
  1679. // Browser environment sniffing
  1680. var inBrowser = typeof window !== 'undefined';
  1681. var inWeex = typeof WXEnvironment !== 'undefined' && !!WXEnvironment.platform;
  1682. var weexPlatform = inWeex && WXEnvironment.platform.toLowerCase();
  1683. var UA = inBrowser && window.navigator.userAgent.toLowerCase();
  1684. var isIE = UA && /msie|trident/.test(UA);
  1685. var isIE9 = UA && UA.indexOf('msie 9.0') > 0;
  1686. var isEdge = UA && UA.indexOf('edge/') > 0;
  1687. var isAndroid = (UA && UA.indexOf('android') > 0) || (weexPlatform === 'android');
  1688. var isIOS = (UA && /iphone|ipad|ipod|ios/.test(UA)) || (weexPlatform === 'ios');
  1689. var isChrome = UA && /chrome\/\d+/.test(UA) && !isEdge;
  1690. var isPhantomJS = UA && /phantomjs/.test(UA);
  1691. var isFF = UA && UA.match(/firefox\/(\d+)/);
  1692. // Firefox has a "watch" function on Object.prototype...
  1693. var nativeWatch = ({}).watch;
  1694. if (inBrowser) {
  1695. try {
  1696. var opts = {};
  1697. Object.defineProperty(opts, 'passive', ({
  1698. get: function get () {
  1699. }
  1700. })); // https://github.com/facebook/flow/issues/285
  1701. window.addEventListener('test-passive', null, opts);
  1702. } catch (e) {}
  1703. }
  1704. // this needs to be lazy-evaled because vue may be required before
  1705. // vue-server-renderer can set VUE_ENV
  1706. var _isServer;
  1707. var isServerRendering = function () {
  1708. if (_isServer === undefined) {
  1709. /* istanbul ignore if */
  1710. if (!inBrowser && !inWeex && typeof global !== 'undefined') {
  1711. // detect presence of vue-server-renderer and avoid
  1712. // Webpack shimming the process
  1713. _isServer = global['process'] && global['process'].env.VUE_ENV === 'server';
  1714. } else {
  1715. _isServer = false;
  1716. }
  1717. }
  1718. return _isServer
  1719. };
  1720. // detect devtools
  1721. var devtools = inBrowser && window.__VUE_DEVTOOLS_GLOBAL_HOOK__;
  1722. /* istanbul ignore next */
  1723. function isNative (Ctor) {
  1724. return typeof Ctor === 'function' && /native code/.test(Ctor.toString())
  1725. }
  1726. var hasSymbol =
  1727. typeof Symbol !== 'undefined' && isNative(Symbol) &&
  1728. typeof Reflect !== 'undefined' && isNative(Reflect.ownKeys);
  1729. var _Set;
  1730. /* istanbul ignore if */ // $flow-disable-line
  1731. if (typeof Set !== 'undefined' && isNative(Set)) {
  1732. // use native Set when available.
  1733. _Set = Set;
  1734. } else {
  1735. // a non-standard Set polyfill that only works with primitive keys.
  1736. _Set = /*@__PURE__*/(function () {
  1737. function Set () {
  1738. this.set = Object.create(null);
  1739. }
  1740. Set.prototype.has = function has (key) {
  1741. return this.set[key] === true
  1742. };
  1743. Set.prototype.add = function add (key) {
  1744. this.set[key] = true;
  1745. };
  1746. Set.prototype.clear = function clear () {
  1747. this.set = Object.create(null);
  1748. };
  1749. return Set;
  1750. }());
  1751. }
  1752. /* */
  1753. var warn = noop;
  1754. var tip = noop;
  1755. var generateComponentTrace = (noop); // work around flow check
  1756. var formatComponentName = (noop);
  1757. if (true) {
  1758. var hasConsole = typeof console !== 'undefined';
  1759. var classifyRE = /(?:^|[-_])(\w)/g;
  1760. var classify = function (str) { return str
  1761. .replace(classifyRE, function (c) { return c.toUpperCase(); })
  1762. .replace(/[-_]/g, ''); };
  1763. warn = function (msg, vm) {
  1764. var trace = vm ? generateComponentTrace(vm) : '';
  1765. if (config.warnHandler) {
  1766. config.warnHandler.call(null, msg, vm, trace);
  1767. } else if (hasConsole && (!config.silent)) {
  1768. console.error(("[Vue warn]: " + msg + trace));
  1769. }
  1770. };
  1771. tip = function (msg, vm) {
  1772. if (hasConsole && (!config.silent)) {
  1773. console.warn("[Vue tip]: " + msg + (
  1774. vm ? generateComponentTrace(vm) : ''
  1775. ));
  1776. }
  1777. };
  1778. formatComponentName = function (vm, includeFile) {
  1779. {
  1780. if(vm.$scope && vm.$scope.is){
  1781. return vm.$scope.is
  1782. }
  1783. }
  1784. if (vm.$root === vm) {
  1785. return '<Root>'
  1786. }
  1787. var options = typeof vm === 'function' && vm.cid != null
  1788. ? vm.options
  1789. : vm._isVue
  1790. ? vm.$options || vm.constructor.options
  1791. : vm;
  1792. var name = options.name || options._componentTag;
  1793. var file = options.__file;
  1794. if (!name && file) {
  1795. var match = file.match(/([^/\\]+)\.vue$/);
  1796. name = match && match[1];
  1797. }
  1798. return (
  1799. (name ? ("<" + (classify(name)) + ">") : "<Anonymous>") +
  1800. (file && includeFile !== false ? (" at " + file) : '')
  1801. )
  1802. };
  1803. var repeat = function (str, n) {
  1804. var res = '';
  1805. while (n) {
  1806. if (n % 2 === 1) { res += str; }
  1807. if (n > 1) { str += str; }
  1808. n >>= 1;
  1809. }
  1810. return res
  1811. };
  1812. generateComponentTrace = function (vm) {
  1813. if (vm._isVue && vm.$parent) {
  1814. var tree = [];
  1815. var currentRecursiveSequence = 0;
  1816. while (vm) {
  1817. if (tree.length > 0) {
  1818. var last = tree[tree.length - 1];
  1819. if (last.constructor === vm.constructor) {
  1820. currentRecursiveSequence++;
  1821. vm = vm.$parent;
  1822. continue
  1823. } else if (currentRecursiveSequence > 0) {
  1824. tree[tree.length - 1] = [last, currentRecursiveSequence];
  1825. currentRecursiveSequence = 0;
  1826. }
  1827. }
  1828. tree.push(vm);
  1829. vm = vm.$parent;
  1830. }
  1831. return '\n\nfound in\n\n' + tree
  1832. .map(function (vm, i) { return ("" + (i === 0 ? '---> ' : repeat(' ', 5 + i * 2)) + (Array.isArray(vm)
  1833. ? ((formatComponentName(vm[0])) + "... (" + (vm[1]) + " recursive calls)")
  1834. : formatComponentName(vm))); })
  1835. .join('\n')
  1836. } else {
  1837. return ("\n\n(found in " + (formatComponentName(vm)) + ")")
  1838. }
  1839. };
  1840. }
  1841. /* */
  1842. var uid = 0;
  1843. /**
  1844. * A dep is an observable that can have multiple
  1845. * directives subscribing to it.
  1846. */
  1847. var Dep = function Dep () {
  1848. this.id = uid++;
  1849. this.subs = [];
  1850. };
  1851. Dep.prototype.addSub = function addSub (sub) {
  1852. this.subs.push(sub);
  1853. };
  1854. Dep.prototype.removeSub = function removeSub (sub) {
  1855. remove(this.subs, sub);
  1856. };
  1857. Dep.prototype.depend = function depend () {
  1858. if (Dep.target) {
  1859. Dep.target.addDep(this);
  1860. }
  1861. };
  1862. Dep.prototype.notify = function notify () {
  1863. // stabilize the subscriber list first
  1864. var subs = this.subs.slice();
  1865. if ( true && !config.async) {
  1866. // subs aren't sorted in scheduler if not running async
  1867. // we need to sort them now to make sure they fire in correct
  1868. // order
  1869. subs.sort(function (a, b) { return a.id - b.id; });
  1870. }
  1871. for (var i = 0, l = subs.length; i < l; i++) {
  1872. subs[i].update();
  1873. }
  1874. };
  1875. // The current target watcher being evaluated.
  1876. // This is globally unique because only one watcher
  1877. // can be evaluated at a time.
  1878. Dep.target = null;
  1879. var targetStack = [];
  1880. function pushTarget (target) {
  1881. targetStack.push(target);
  1882. Dep.target = target;
  1883. }
  1884. function popTarget () {
  1885. targetStack.pop();
  1886. Dep.target = targetStack[targetStack.length - 1];
  1887. }
  1888. /* */
  1889. var VNode = function VNode (
  1890. tag,
  1891. data,
  1892. children,
  1893. text,
  1894. elm,
  1895. context,
  1896. componentOptions,
  1897. asyncFactory
  1898. ) {
  1899. this.tag = tag;
  1900. this.data = data;
  1901. this.children = children;
  1902. this.text = text;
  1903. this.elm = elm;
  1904. this.ns = undefined;
  1905. this.context = context;
  1906. this.fnContext = undefined;
  1907. this.fnOptions = undefined;
  1908. this.fnScopeId = undefined;
  1909. this.key = data && data.key;
  1910. this.componentOptions = componentOptions;
  1911. this.componentInstance = undefined;
  1912. this.parent = undefined;
  1913. this.raw = false;
  1914. this.isStatic = false;
  1915. this.isRootInsert = true;
  1916. this.isComment = false;
  1917. this.isCloned = false;
  1918. this.isOnce = false;
  1919. this.asyncFactory = asyncFactory;
  1920. this.asyncMeta = undefined;
  1921. this.isAsyncPlaceholder = false;
  1922. };
  1923. var prototypeAccessors = { child: { configurable: true } };
  1924. // DEPRECATED: alias for componentInstance for backwards compat.
  1925. /* istanbul ignore next */
  1926. prototypeAccessors.child.get = function () {
  1927. return this.componentInstance
  1928. };
  1929. Object.defineProperties( VNode.prototype, prototypeAccessors );
  1930. var createEmptyVNode = function (text) {
  1931. if ( text === void 0 ) text = '';
  1932. var node = new VNode();
  1933. node.text = text;
  1934. node.isComment = true;
  1935. return node
  1936. };
  1937. function createTextVNode (val) {
  1938. return new VNode(undefined, undefined, undefined, String(val))
  1939. }
  1940. // optimized shallow clone
  1941. // used for static nodes and slot nodes because they may be reused across
  1942. // multiple renders, cloning them avoids errors when DOM manipulations rely
  1943. // on their elm reference.
  1944. function cloneVNode (vnode) {
  1945. var cloned = new VNode(
  1946. vnode.tag,
  1947. vnode.data,
  1948. // #7975
  1949. // clone children array to avoid mutating original in case of cloning
  1950. // a child.
  1951. vnode.children && vnode.children.slice(),
  1952. vnode.text,
  1953. vnode.elm,
  1954. vnode.context,
  1955. vnode.componentOptions,
  1956. vnode.asyncFactory
  1957. );
  1958. cloned.ns = vnode.ns;
  1959. cloned.isStatic = vnode.isStatic;
  1960. cloned.key = vnode.key;
  1961. cloned.isComment = vnode.isComment;
  1962. cloned.fnContext = vnode.fnContext;
  1963. cloned.fnOptions = vnode.fnOptions;
  1964. cloned.fnScopeId = vnode.fnScopeId;
  1965. cloned.asyncMeta = vnode.asyncMeta;
  1966. cloned.isCloned = true;
  1967. return cloned
  1968. }
  1969. /*
  1970. * not type checking this file because flow doesn't play well with
  1971. * dynamically accessing methods on Array prototype
  1972. */
  1973. var arrayProto = Array.prototype;
  1974. var arrayMethods = Object.create(arrayProto);
  1975. var methodsToPatch = [
  1976. 'push',
  1977. 'pop',
  1978. 'shift',
  1979. 'unshift',
  1980. 'splice',
  1981. 'sort',
  1982. 'reverse'
  1983. ];
  1984. /**
  1985. * Intercept mutating methods and emit events
  1986. */
  1987. methodsToPatch.forEach(function (method) {
  1988. // cache original method
  1989. var original = arrayProto[method];
  1990. def(arrayMethods, method, function mutator () {
  1991. var args = [], len = arguments.length;
  1992. while ( len-- ) args[ len ] = arguments[ len ];
  1993. var result = original.apply(this, args);
  1994. var ob = this.__ob__;
  1995. var inserted;
  1996. switch (method) {
  1997. case 'push':
  1998. case 'unshift':
  1999. inserted = args;
  2000. break
  2001. case 'splice':
  2002. inserted = args.slice(2);
  2003. break
  2004. }
  2005. if (inserted) { ob.observeArray(inserted); }
  2006. // notify change
  2007. ob.dep.notify();
  2008. return result
  2009. });
  2010. });
  2011. /* */
  2012. var arrayKeys = Object.getOwnPropertyNames(arrayMethods);
  2013. /**
  2014. * In some cases we may want to disable observation inside a component's
  2015. * update computation.
  2016. */
  2017. var shouldObserve = true;
  2018. function toggleObserving (value) {
  2019. shouldObserve = value;
  2020. }
  2021. /**
  2022. * Observer class that is attached to each observed
  2023. * object. Once attached, the observer converts the target
  2024. * object's property keys into getter/setters that
  2025. * collect dependencies and dispatch updates.
  2026. */
  2027. var Observer = function Observer (value) {
  2028. this.value = value;
  2029. this.dep = new Dep();
  2030. this.vmCount = 0;
  2031. def(value, '__ob__', this);
  2032. if (Array.isArray(value)) {
  2033. if (hasProto) {
  2034. protoAugment(value, arrayMethods);
  2035. } else {
  2036. copyAugment(value, arrayMethods, arrayKeys);
  2037. }
  2038. this.observeArray(value);
  2039. } else {
  2040. this.walk(value);
  2041. }
  2042. };
  2043. /**
  2044. * Walk through all properties and convert them into
  2045. * getter/setters. This method should only be called when
  2046. * value type is Object.
  2047. */
  2048. Observer.prototype.walk = function walk (obj) {
  2049. var keys = Object.keys(obj);
  2050. for (var i = 0; i < keys.length; i++) {
  2051. defineReactive$$1(obj, keys[i]);
  2052. }
  2053. };
  2054. /**
  2055. * Observe a list of Array items.
  2056. */
  2057. Observer.prototype.observeArray = function observeArray (items) {
  2058. for (var i = 0, l = items.length; i < l; i++) {
  2059. observe(items[i]);
  2060. }
  2061. };
  2062. // helpers
  2063. /**
  2064. * Augment a target Object or Array by intercepting
  2065. * the prototype chain using __proto__
  2066. */
  2067. function protoAugment (target, src) {
  2068. /* eslint-disable no-proto */
  2069. target.__proto__ = src;
  2070. /* eslint-enable no-proto */
  2071. }
  2072. /**
  2073. * Augment a target Object or Array by defining
  2074. * hidden properties.
  2075. */
  2076. /* istanbul ignore next */
  2077. function copyAugment (target, src, keys) {
  2078. for (var i = 0, l = keys.length; i < l; i++) {
  2079. var key = keys[i];
  2080. def(target, key, src[key]);
  2081. }
  2082. }
  2083. /**
  2084. * Attempt to create an observer instance for a value,
  2085. * returns the new observer if successfully observed,
  2086. * or the existing observer if the value already has one.
  2087. */
  2088. function observe (value, asRootData) {
  2089. if (!isObject(value) || value instanceof VNode) {
  2090. return
  2091. }
  2092. var ob;
  2093. if (hasOwn(value, '__ob__') && value.__ob__ instanceof Observer) {
  2094. ob = value.__ob__;
  2095. } else if (
  2096. shouldObserve &&
  2097. !isServerRendering() &&
  2098. (Array.isArray(value) || isPlainObject(value)) &&
  2099. Object.isExtensible(value) &&
  2100. !value._isVue
  2101. ) {
  2102. ob = new Observer(value);
  2103. }
  2104. if (asRootData && ob) {
  2105. ob.vmCount++;
  2106. }
  2107. return ob
  2108. }
  2109. /**
  2110. * Define a reactive property on an Object.
  2111. */
  2112. function defineReactive$$1 (
  2113. obj,
  2114. key,
  2115. val,
  2116. customSetter,
  2117. shallow
  2118. ) {
  2119. var dep = new Dep();
  2120. var property = Object.getOwnPropertyDescriptor(obj, key);
  2121. if (property && property.configurable === false) {
  2122. return
  2123. }
  2124. // cater for pre-defined getter/setters
  2125. var getter = property && property.get;
  2126. var setter = property && property.set;
  2127. if ((!getter || setter) && arguments.length === 2) {
  2128. val = obj[key];
  2129. }
  2130. var childOb = !shallow && observe(val);
  2131. Object.defineProperty(obj, key, {
  2132. enumerable: true,
  2133. configurable: true,
  2134. get: function reactiveGetter () {
  2135. var value = getter ? getter.call(obj) : val;
  2136. if (Dep.target) {
  2137. dep.depend();
  2138. if (childOb) {
  2139. childOb.dep.depend();
  2140. if (Array.isArray(value)) {
  2141. dependArray(value);
  2142. }
  2143. }
  2144. }
  2145. return value
  2146. },
  2147. set: function reactiveSetter (newVal) {
  2148. var value = getter ? getter.call(obj) : val;
  2149. /* eslint-disable no-self-compare */
  2150. if (newVal === value || (newVal !== newVal && value !== value)) {
  2151. return
  2152. }
  2153. /* eslint-enable no-self-compare */
  2154. if ( true && customSetter) {
  2155. customSetter();
  2156. }
  2157. // #7981: for accessor properties without setter
  2158. if (getter && !setter) { return }
  2159. if (setter) {
  2160. setter.call(obj, newVal);
  2161. } else {
  2162. val = newVal;
  2163. }
  2164. childOb = !shallow && observe(newVal);
  2165. dep.notify();
  2166. }
  2167. });
  2168. }
  2169. /**
  2170. * Set a property on an object. Adds the new property and
  2171. * triggers change notification if the property doesn't
  2172. * already exist.
  2173. */
  2174. function set (target, key, val) {
  2175. if ( true &&
  2176. (isUndef(target) || isPrimitive(target))
  2177. ) {
  2178. warn(("Cannot set reactive property on undefined, null, or primitive value: " + ((target))));
  2179. }
  2180. if (Array.isArray(target) && isValidArrayIndex(key)) {
  2181. target.length = Math.max(target.length, key);
  2182. target.splice(key, 1, val);
  2183. return val
  2184. }
  2185. if (key in target && !(key in Object.prototype)) {
  2186. target[key] = val;
  2187. return val
  2188. }
  2189. var ob = (target).__ob__;
  2190. if (target._isVue || (ob && ob.vmCount)) {
  2191. true && warn(
  2192. 'Avoid adding reactive properties to a Vue instance or its root $data ' +
  2193. 'at runtime - declare it upfront in the data option.'
  2194. );
  2195. return val
  2196. }
  2197. if (!ob) {
  2198. target[key] = val;
  2199. return val
  2200. }
  2201. defineReactive$$1(ob.value, key, val);
  2202. ob.dep.notify();
  2203. return val
  2204. }
  2205. /**
  2206. * Delete a property and trigger change if necessary.
  2207. */
  2208. function del (target, key) {
  2209. if ( true &&
  2210. (isUndef(target) || isPrimitive(target))
  2211. ) {
  2212. warn(("Cannot delete reactive property on undefined, null, or primitive value: " + ((target))));
  2213. }
  2214. if (Array.isArray(target) && isValidArrayIndex(key)) {
  2215. target.splice(key, 1);
  2216. return
  2217. }
  2218. var ob = (target).__ob__;
  2219. if (target._isVue || (ob && ob.vmCount)) {
  2220. true && warn(
  2221. 'Avoid deleting properties on a Vue instance or its root $data ' +
  2222. '- just set it to null.'
  2223. );
  2224. return
  2225. }
  2226. if (!hasOwn(target, key)) {
  2227. return
  2228. }
  2229. delete target[key];
  2230. if (!ob) {
  2231. return
  2232. }
  2233. ob.dep.notify();
  2234. }
  2235. /**
  2236. * Collect dependencies on array elements when the array is touched, since
  2237. * we cannot intercept array element access like property getters.
  2238. */
  2239. function dependArray (value) {
  2240. for (var e = (void 0), i = 0, l = value.length; i < l; i++) {
  2241. e = value[i];
  2242. e && e.__ob__ && e.__ob__.dep.depend();
  2243. if (Array.isArray(e)) {
  2244. dependArray(e);
  2245. }
  2246. }
  2247. }
  2248. /* */
  2249. /**
  2250. * Option overwriting strategies are functions that handle
  2251. * how to merge a parent option value and a child option
  2252. * value into the final value.
  2253. */
  2254. var strats = config.optionMergeStrategies;
  2255. /**
  2256. * Options with restrictions
  2257. */
  2258. if (true) {
  2259. strats.el = strats.propsData = function (parent, child, vm, key) {
  2260. if (!vm) {
  2261. warn(
  2262. "option \"" + key + "\" can only be used during instance " +
  2263. 'creation with the `new` keyword.'
  2264. );
  2265. }
  2266. return defaultStrat(parent, child)
  2267. };
  2268. }
  2269. /**
  2270. * Helper that recursively merges two data objects together.
  2271. */
  2272. function mergeData (to, from) {
  2273. if (!from) { return to }
  2274. var key, toVal, fromVal;
  2275. var keys = hasSymbol
  2276. ? Reflect.ownKeys(from)
  2277. : Object.keys(from);
  2278. for (var i = 0; i < keys.length; i++) {
  2279. key = keys[i];
  2280. // in case the object is already observed...
  2281. if (key === '__ob__') { continue }
  2282. toVal = to[key];
  2283. fromVal = from[key];
  2284. if (!hasOwn(to, key)) {
  2285. set(to, key, fromVal);
  2286. } else if (
  2287. toVal !== fromVal &&
  2288. isPlainObject(toVal) &&
  2289. isPlainObject(fromVal)
  2290. ) {
  2291. mergeData(toVal, fromVal);
  2292. }
  2293. }
  2294. return to
  2295. }
  2296. /**
  2297. * Data
  2298. */
  2299. function mergeDataOrFn (
  2300. parentVal,
  2301. childVal,
  2302. vm
  2303. ) {
  2304. if (!vm) {
  2305. // in a Vue.extend merge, both should be functions
  2306. if (!childVal) {
  2307. return parentVal
  2308. }
  2309. if (!parentVal) {
  2310. return childVal
  2311. }
  2312. // when parentVal & childVal are both present,
  2313. // we need to return a function that returns the
  2314. // merged result of both functions... no need to
  2315. // check if parentVal is a function here because
  2316. // it has to be a function to pass previous merges.
  2317. return function mergedDataFn () {
  2318. return mergeData(
  2319. typeof childVal === 'function' ? childVal.call(this, this) : childVal,
  2320. typeof parentVal === 'function' ? parentVal.call(this, this) : parentVal
  2321. )
  2322. }
  2323. } else {
  2324. return function mergedInstanceDataFn () {
  2325. // instance merge
  2326. var instanceData = typeof childVal === 'function'
  2327. ? childVal.call(vm, vm)
  2328. : childVal;
  2329. var defaultData = typeof parentVal === 'function'
  2330. ? parentVal.call(vm, vm)
  2331. : parentVal;
  2332. if (instanceData) {
  2333. return mergeData(instanceData, defaultData)
  2334. } else {
  2335. return defaultData
  2336. }
  2337. }
  2338. }
  2339. }
  2340. strats.data = function (
  2341. parentVal,
  2342. childVal,
  2343. vm
  2344. ) {
  2345. if (!vm) {
  2346. if (childVal && typeof childVal !== 'function') {
  2347. true && warn(
  2348. 'The "data" option should be a function ' +
  2349. 'that returns a per-instance value in component ' +
  2350. 'definitions.',
  2351. vm
  2352. );
  2353. return parentVal
  2354. }
  2355. return mergeDataOrFn(parentVal, childVal)
  2356. }
  2357. return mergeDataOrFn(parentVal, childVal, vm)
  2358. };
  2359. /**
  2360. * Hooks and props are merged as arrays.
  2361. */
  2362. function mergeHook (
  2363. parentVal,
  2364. childVal
  2365. ) {
  2366. var res = childVal
  2367. ? parentVal
  2368. ? parentVal.concat(childVal)
  2369. : Array.isArray(childVal)
  2370. ? childVal
  2371. : [childVal]
  2372. : parentVal;
  2373. return res
  2374. ? dedupeHooks(res)
  2375. : res
  2376. }
  2377. function dedupeHooks (hooks) {
  2378. var res = [];
  2379. for (var i = 0; i < hooks.length; i++) {
  2380. if (res.indexOf(hooks[i]) === -1) {
  2381. res.push(hooks[i]);
  2382. }
  2383. }
  2384. return res
  2385. }
  2386. LIFECYCLE_HOOKS.forEach(function (hook) {
  2387. strats[hook] = mergeHook;
  2388. });
  2389. /**
  2390. * Assets
  2391. *
  2392. * When a vm is present (instance creation), we need to do
  2393. * a three-way merge between constructor options, instance
  2394. * options and parent options.
  2395. */
  2396. function mergeAssets (
  2397. parentVal,
  2398. childVal,
  2399. vm,
  2400. key
  2401. ) {
  2402. var res = Object.create(parentVal || null);
  2403. if (childVal) {
  2404. true && assertObjectType(key, childVal, vm);
  2405. return extend(res, childVal)
  2406. } else {
  2407. return res
  2408. }
  2409. }
  2410. ASSET_TYPES.forEach(function (type) {
  2411. strats[type + 's'] = mergeAssets;
  2412. });
  2413. /**
  2414. * Watchers.
  2415. *
  2416. * Watchers hashes should not overwrite one
  2417. * another, so we merge them as arrays.
  2418. */
  2419. strats.watch = function (
  2420. parentVal,
  2421. childVal,
  2422. vm,
  2423. key
  2424. ) {
  2425. // work around Firefox's Object.prototype.watch...
  2426. if (parentVal === nativeWatch) { parentVal = undefined; }
  2427. if (childVal === nativeWatch) { childVal = undefined; }
  2428. /* istanbul ignore if */
  2429. if (!childVal) { return Object.create(parentVal || null) }
  2430. if (true) {
  2431. assertObjectType(key, childVal, vm);
  2432. }
  2433. if (!parentVal) { return childVal }
  2434. var ret = {};
  2435. extend(ret, parentVal);
  2436. for (var key$1 in childVal) {
  2437. var parent = ret[key$1];
  2438. var child = childVal[key$1];
  2439. if (parent && !Array.isArray(parent)) {
  2440. parent = [parent];
  2441. }
  2442. ret[key$1] = parent
  2443. ? parent.concat(child)
  2444. : Array.isArray(child) ? child : [child];
  2445. }
  2446. return ret
  2447. };
  2448. /**
  2449. * Other object hashes.
  2450. */
  2451. strats.props =
  2452. strats.methods =
  2453. strats.inject =
  2454. strats.computed = function (
  2455. parentVal,
  2456. childVal,
  2457. vm,
  2458. key
  2459. ) {
  2460. if (childVal && "development" !== 'production') {
  2461. assertObjectType(key, childVal, vm);
  2462. }
  2463. if (!parentVal) { return childVal }
  2464. var ret = Object.create(null);
  2465. extend(ret, parentVal);
  2466. if (childVal) { extend(ret, childVal); }
  2467. return ret
  2468. };
  2469. strats.provide = mergeDataOrFn;
  2470. /**
  2471. * Default strategy.
  2472. */
  2473. var defaultStrat = function (parentVal, childVal) {
  2474. return childVal === undefined
  2475. ? parentVal
  2476. : childVal
  2477. };
  2478. /**
  2479. * Validate component names
  2480. */
  2481. function checkComponents (options) {
  2482. for (var key in options.components) {
  2483. validateComponentName(key);
  2484. }
  2485. }
  2486. function validateComponentName (name) {
  2487. if (!new RegExp(("^[a-zA-Z][\\-\\.0-9_" + (unicodeRegExp.source) + "]*$")).test(name)) {
  2488. warn(
  2489. 'Invalid component name: "' + name + '". Component names ' +
  2490. 'should conform to valid custom element name in html5 specification.'
  2491. );
  2492. }
  2493. if (isBuiltInTag(name) || config.isReservedTag(name)) {
  2494. warn(
  2495. 'Do not use built-in or reserved HTML elements as component ' +
  2496. 'id: ' + name
  2497. );
  2498. }
  2499. }
  2500. /**
  2501. * Ensure all props option syntax are normalized into the
  2502. * Object-based format.
  2503. */
  2504. function normalizeProps (options, vm) {
  2505. var props = options.props;
  2506. if (!props) { return }
  2507. var res = {};
  2508. var i, val, name;
  2509. if (Array.isArray(props)) {
  2510. i = props.length;
  2511. while (i--) {
  2512. val = props[i];
  2513. if (typeof val === 'string') {
  2514. name = camelize(val);
  2515. res[name] = { type: null };
  2516. } else if (true) {
  2517. warn('props must be strings when using array syntax.');
  2518. }
  2519. }
  2520. } else if (isPlainObject(props)) {
  2521. for (var key in props) {
  2522. val = props[key];
  2523. name = camelize(key);
  2524. res[name] = isPlainObject(val)
  2525. ? val
  2526. : { type: val };
  2527. }
  2528. } else if (true) {
  2529. warn(
  2530. "Invalid value for option \"props\": expected an Array or an Object, " +
  2531. "but got " + (toRawType(props)) + ".",
  2532. vm
  2533. );
  2534. }
  2535. options.props = res;
  2536. }
  2537. /**
  2538. * Normalize all injections into Object-based format
  2539. */
  2540. function normalizeInject (options, vm) {
  2541. var inject = options.inject;
  2542. if (!inject) { return }
  2543. var normalized = options.inject = {};
  2544. if (Array.isArray(inject)) {
  2545. for (var i = 0; i < inject.length; i++) {
  2546. normalized[inject[i]] = { from: inject[i] };
  2547. }
  2548. } else if (isPlainObject(inject)) {
  2549. for (var key in inject) {
  2550. var val = inject[key];
  2551. normalized[key] = isPlainObject(val)
  2552. ? extend({ from: key }, val)
  2553. : { from: val };
  2554. }
  2555. } else if (true) {
  2556. warn(
  2557. "Invalid value for option \"inject\": expected an Array or an Object, " +
  2558. "but got " + (toRawType(inject)) + ".",
  2559. vm
  2560. );
  2561. }
  2562. }
  2563. /**
  2564. * Normalize raw function directives into object format.
  2565. */
  2566. function normalizeDirectives (options) {
  2567. var dirs = options.directives;
  2568. if (dirs) {
  2569. for (var key in dirs) {
  2570. var def$$1 = dirs[key];
  2571. if (typeof def$$1 === 'function') {
  2572. dirs[key] = { bind: def$$1, update: def$$1 };
  2573. }
  2574. }
  2575. }
  2576. }
  2577. function assertObjectType (name, value, vm) {
  2578. if (!isPlainObject(value)) {
  2579. warn(
  2580. "Invalid value for option \"" + name + "\": expected an Object, " +
  2581. "but got " + (toRawType(value)) + ".",
  2582. vm
  2583. );
  2584. }
  2585. }
  2586. /**
  2587. * Merge two option objects into a new one.
  2588. * Core utility used in both instantiation and inheritance.
  2589. */
  2590. function mergeOptions (
  2591. parent,
  2592. child,
  2593. vm
  2594. ) {
  2595. if (true) {
  2596. checkComponents(child);
  2597. }
  2598. if (typeof child === 'function') {
  2599. child = child.options;
  2600. }
  2601. normalizeProps(child, vm);
  2602. normalizeInject(child, vm);
  2603. normalizeDirectives(child);
  2604. // Apply extends and mixins on the child options,
  2605. // but only if it is a raw options object that isn't
  2606. // the result of another mergeOptions call.
  2607. // Only merged options has the _base property.
  2608. if (!child._base) {
  2609. if (child.extends) {
  2610. parent = mergeOptions(parent, child.extends, vm);
  2611. }
  2612. if (child.mixins) {
  2613. for (var i = 0, l = child.mixins.length; i < l; i++) {
  2614. parent = mergeOptions(parent, child.mixins[i], vm);
  2615. }
  2616. }
  2617. }
  2618. var options = {};
  2619. var key;
  2620. for (key in parent) {
  2621. mergeField(key);
  2622. }
  2623. for (key in child) {
  2624. if (!hasOwn(parent, key)) {
  2625. mergeField(key);
  2626. }
  2627. }
  2628. function mergeField (key) {
  2629. var strat = strats[key] || defaultStrat;
  2630. options[key] = strat(parent[key], child[key], vm, key);
  2631. }
  2632. return options
  2633. }
  2634. /**
  2635. * Resolve an asset.
  2636. * This function is used because child instances need access
  2637. * to assets defined in its ancestor chain.
  2638. */
  2639. function resolveAsset (
  2640. options,
  2641. type,
  2642. id,
  2643. warnMissing
  2644. ) {
  2645. /* istanbul ignore if */
  2646. if (typeof id !== 'string') {
  2647. return
  2648. }
  2649. var assets = options[type];
  2650. // check local registration variations first
  2651. if (hasOwn(assets, id)) { return assets[id] }
  2652. var camelizedId = camelize(id);
  2653. if (hasOwn(assets, camelizedId)) { return assets[camelizedId] }
  2654. var PascalCaseId = capitalize(camelizedId);
  2655. if (hasOwn(assets, PascalCaseId)) { return assets[PascalCaseId] }
  2656. // fallback to prototype chain
  2657. var res = assets[id] || assets[camelizedId] || assets[PascalCaseId];
  2658. if ( true && warnMissing && !res) {
  2659. warn(
  2660. 'Failed to resolve ' + type.slice(0, -1) + ': ' + id,
  2661. options
  2662. );
  2663. }
  2664. return res
  2665. }
  2666. /* */
  2667. function validateProp (
  2668. key,
  2669. propOptions,
  2670. propsData,
  2671. vm
  2672. ) {
  2673. var prop = propOptions[key];
  2674. var absent = !hasOwn(propsData, key);
  2675. var value = propsData[key];
  2676. // boolean casting
  2677. var booleanIndex = getTypeIndex(Boolean, prop.type);
  2678. if (booleanIndex > -1) {
  2679. if (absent && !hasOwn(prop, 'default')) {
  2680. value = false;
  2681. } else if (value === '' || value === hyphenate(key)) {
  2682. // only cast empty string / same name to boolean if
  2683. // boolean has higher priority
  2684. var stringIndex = getTypeIndex(String, prop.type);
  2685. if (stringIndex < 0 || booleanIndex < stringIndex) {
  2686. value = true;
  2687. }
  2688. }
  2689. }
  2690. // check default value
  2691. if (value === undefined) {
  2692. value = getPropDefaultValue(vm, prop, key);
  2693. // since the default value is a fresh copy,
  2694. // make sure to observe it.
  2695. var prevShouldObserve = shouldObserve;
  2696. toggleObserving(true);
  2697. observe(value);
  2698. toggleObserving(prevShouldObserve);
  2699. }
  2700. if (
  2701. true
  2702. ) {
  2703. assertProp(prop, key, value, vm, absent);
  2704. }
  2705. return value
  2706. }
  2707. /**
  2708. * Get the default value of a prop.
  2709. */
  2710. function getPropDefaultValue (vm, prop, key) {
  2711. // no default, return undefined
  2712. if (!hasOwn(prop, 'default')) {
  2713. return undefined
  2714. }
  2715. var def = prop.default;
  2716. // warn against non-factory defaults for Object & Array
  2717. if ( true && isObject(def)) {
  2718. warn(
  2719. 'Invalid default value for prop "' + key + '": ' +
  2720. 'Props with type Object/Array must use a factory function ' +
  2721. 'to return the default value.',
  2722. vm
  2723. );
  2724. }
  2725. // the raw prop value was also undefined from previous render,
  2726. // return previous default value to avoid unnecessary watcher trigger
  2727. if (vm && vm.$options.propsData &&
  2728. vm.$options.propsData[key] === undefined &&
  2729. vm._props[key] !== undefined
  2730. ) {
  2731. return vm._props[key]
  2732. }
  2733. // call factory function for non-Function types
  2734. // a value is Function if its prototype is function even across different execution context
  2735. return typeof def === 'function' && getType(prop.type) !== 'Function'
  2736. ? def.call(vm)
  2737. : def
  2738. }
  2739. /**
  2740. * Assert whether a prop is valid.
  2741. */
  2742. function assertProp (
  2743. prop,
  2744. name,
  2745. value,
  2746. vm,
  2747. absent
  2748. ) {
  2749. if (prop.required && absent) {
  2750. warn(
  2751. 'Missing required prop: "' + name + '"',
  2752. vm
  2753. );
  2754. return
  2755. }
  2756. if (value == null && !prop.required) {
  2757. return
  2758. }
  2759. var type = prop.type;
  2760. var valid = !type || type === true;
  2761. var expectedTypes = [];
  2762. if (type) {
  2763. if (!Array.isArray(type)) {
  2764. type = [type];
  2765. }
  2766. for (var i = 0; i < type.length && !valid; i++) {
  2767. var assertedType = assertType(value, type[i]);
  2768. expectedTypes.push(assertedType.expectedType || '');
  2769. valid = assertedType.valid;
  2770. }
  2771. }
  2772. if (!valid) {
  2773. warn(
  2774. getInvalidTypeMessage(name, value, expectedTypes),
  2775. vm
  2776. );
  2777. return
  2778. }
  2779. var validator = prop.validator;
  2780. if (validator) {
  2781. if (!validator(value)) {
  2782. warn(
  2783. 'Invalid prop: custom validator check failed for prop "' + name + '".',
  2784. vm
  2785. );
  2786. }
  2787. }
  2788. }
  2789. var simpleCheckRE = /^(String|Number|Boolean|Function|Symbol)$/;
  2790. function assertType (value, type) {
  2791. var valid;
  2792. var expectedType = getType(type);
  2793. if (simpleCheckRE.test(expectedType)) {
  2794. var t = typeof value;
  2795. valid = t === expectedType.toLowerCase();
  2796. // for primitive wrapper objects
  2797. if (!valid && t === 'object') {
  2798. valid = value instanceof type;
  2799. }
  2800. } else if (expectedType === 'Object') {
  2801. valid = isPlainObject(value);
  2802. } else if (expectedType === 'Array') {
  2803. valid = Array.isArray(value);
  2804. } else {
  2805. valid = value instanceof type;
  2806. }
  2807. return {
  2808. valid: valid,
  2809. expectedType: expectedType
  2810. }
  2811. }
  2812. /**
  2813. * Use function string name to check built-in types,
  2814. * because a simple equality check will fail when running
  2815. * across different vms / iframes.
  2816. */
  2817. function getType (fn) {
  2818. var match = fn && fn.toString().match(/^\s*function (\w+)/);
  2819. return match ? match[1] : ''
  2820. }
  2821. function isSameType (a, b) {
  2822. return getType(a) === getType(b)
  2823. }
  2824. function getTypeIndex (type, expectedTypes) {
  2825. if (!Array.isArray(expectedTypes)) {
  2826. return isSameType(expectedTypes, type) ? 0 : -1
  2827. }
  2828. for (var i = 0, len = expectedTypes.length; i < len; i++) {
  2829. if (isSameType(expectedTypes[i], type)) {
  2830. return i
  2831. }
  2832. }
  2833. return -1
  2834. }
  2835. function getInvalidTypeMessage (name, value, expectedTypes) {
  2836. var message = "Invalid prop: type check failed for prop \"" + name + "\"." +
  2837. " Expected " + (expectedTypes.map(capitalize).join(', '));
  2838. var expectedType = expectedTypes[0];
  2839. var receivedType = toRawType(value);
  2840. var expectedValue = styleValue(value, expectedType);
  2841. var receivedValue = styleValue(value, receivedType);
  2842. // check if we need to specify expected value
  2843. if (expectedTypes.length === 1 &&
  2844. isExplicable(expectedType) &&
  2845. !isBoolean(expectedType, receivedType)) {
  2846. message += " with value " + expectedValue;
  2847. }
  2848. message += ", got " + receivedType + " ";
  2849. // check if we need to specify received value
  2850. if (isExplicable(receivedType)) {
  2851. message += "with value " + receivedValue + ".";
  2852. }
  2853. return message
  2854. }
  2855. function styleValue (value, type) {
  2856. if (type === 'String') {
  2857. return ("\"" + value + "\"")
  2858. } else if (type === 'Number') {
  2859. return ("" + (Number(value)))
  2860. } else {
  2861. return ("" + value)
  2862. }
  2863. }
  2864. function isExplicable (value) {
  2865. var explicitTypes = ['string', 'number', 'boolean'];
  2866. return explicitTypes.some(function (elem) { return value.toLowerCase() === elem; })
  2867. }
  2868. function isBoolean () {
  2869. var args = [], len = arguments.length;
  2870. while ( len-- ) args[ len ] = arguments[ len ];
  2871. return args.some(function (elem) { return elem.toLowerCase() === 'boolean'; })
  2872. }
  2873. /* */
  2874. function handleError (err, vm, info) {
  2875. // Deactivate deps tracking while processing error handler to avoid possible infinite rendering.
  2876. // See: https://github.com/vuejs/vuex/issues/1505
  2877. pushTarget();
  2878. try {
  2879. if (vm) {
  2880. var cur = vm;
  2881. while ((cur = cur.$parent)) {
  2882. var hooks = cur.$options.errorCaptured;
  2883. if (hooks) {
  2884. for (var i = 0; i < hooks.length; i++) {
  2885. try {
  2886. var capture = hooks[i].call(cur, err, vm, info) === false;
  2887. if (capture) { return }
  2888. } catch (e) {
  2889. globalHandleError(e, cur, 'errorCaptured hook');
  2890. }
  2891. }
  2892. }
  2893. }
  2894. }
  2895. globalHandleError(err, vm, info);
  2896. } finally {
  2897. popTarget();
  2898. }
  2899. }
  2900. function invokeWithErrorHandling (
  2901. handler,
  2902. context,
  2903. args,
  2904. vm,
  2905. info
  2906. ) {
  2907. var res;
  2908. try {
  2909. res = args ? handler.apply(context, args) : handler.call(context);
  2910. if (res && !res._isVue && isPromise(res) && !res._handled) {
  2911. res.catch(function (e) { return handleError(e, vm, info + " (Promise/async)"); });
  2912. // issue #9511
  2913. // avoid catch triggering multiple times when nested calls
  2914. res._handled = true;
  2915. }
  2916. } catch (e) {
  2917. handleError(e, vm, info);
  2918. }
  2919. return res
  2920. }
  2921. function globalHandleError (err, vm, info) {
  2922. if (config.errorHandler) {
  2923. try {
  2924. return config.errorHandler.call(null, err, vm, info)
  2925. } catch (e) {
  2926. // if the user intentionally throws the original error in the handler,
  2927. // do not log it twice
  2928. if (e !== err) {
  2929. logError(e, null, 'config.errorHandler');
  2930. }
  2931. }
  2932. }
  2933. logError(err, vm, info);
  2934. }
  2935. function logError (err, vm, info) {
  2936. if (true) {
  2937. warn(("Error in " + info + ": \"" + (err.toString()) + "\""), vm);
  2938. }
  2939. /* istanbul ignore else */
  2940. if ((inBrowser || inWeex) && typeof console !== 'undefined') {
  2941. console.error(err);
  2942. } else {
  2943. throw err
  2944. }
  2945. }
  2946. /* */
  2947. var callbacks = [];
  2948. var pending = false;
  2949. function flushCallbacks () {
  2950. pending = false;
  2951. var copies = callbacks.slice(0);
  2952. callbacks.length = 0;
  2953. for (var i = 0; i < copies.length; i++) {
  2954. copies[i]();
  2955. }
  2956. }
  2957. // Here we have async deferring wrappers using microtasks.
  2958. // In 2.5 we used (macro) tasks (in combination with microtasks).
  2959. // However, it has subtle problems when state is changed right before repaint
  2960. // (e.g. #6813, out-in transitions).
  2961. // Also, using (macro) tasks in event handler would cause some weird behaviors
  2962. // that cannot be circumvented (e.g. #7109, #7153, #7546, #7834, #8109).
  2963. // So we now use microtasks everywhere, again.
  2964. // A major drawback of this tradeoff is that there are some scenarios
  2965. // where microtasks have too high a priority and fire in between supposedly
  2966. // sequential events (e.g. #4521, #6690, which have workarounds)
  2967. // or even between bubbling of the same event (#6566).
  2968. var timerFunc;
  2969. // The nextTick behavior leverages the microtask queue, which can be accessed
  2970. // via either native Promise.then or MutationObserver.
  2971. // MutationObserver has wider support, however it is seriously bugged in
  2972. // UIWebView in iOS >= 9.3.3 when triggered in touch event handlers. It
  2973. // completely stops working after triggering a few times... so, if native
  2974. // Promise is available, we will use it:
  2975. /* istanbul ignore next, $flow-disable-line */
  2976. if (typeof Promise !== 'undefined' && isNative(Promise)) {
  2977. var p = Promise.resolve();
  2978. timerFunc = function () {
  2979. p.then(flushCallbacks);
  2980. // In problematic UIWebViews, Promise.then doesn't completely break, but
  2981. // it can get stuck in a weird state where callbacks are pushed into the
  2982. // microtask queue but the queue isn't being flushed, until the browser
  2983. // needs to do some other work, e.g. handle a timer. Therefore we can
  2984. // "force" the microtask queue to be flushed by adding an empty timer.
  2985. if (isIOS) { setTimeout(noop); }
  2986. };
  2987. } else if (!isIE && typeof MutationObserver !== 'undefined' && (
  2988. isNative(MutationObserver) ||
  2989. // PhantomJS and iOS 7.x
  2990. MutationObserver.toString() === '[object MutationObserverConstructor]'
  2991. )) {
  2992. // Use MutationObserver where native Promise is not available,
  2993. // e.g. PhantomJS, iOS7, Android 4.4
  2994. // (#6466 MutationObserver is unreliable in IE11)
  2995. var counter = 1;
  2996. var observer = new MutationObserver(flushCallbacks);
  2997. var textNode = document.createTextNode(String(counter));
  2998. observer.observe(textNode, {
  2999. characterData: true
  3000. });
  3001. timerFunc = function () {
  3002. counter = (counter + 1) % 2;
  3003. textNode.data = String(counter);
  3004. };
  3005. } else if (typeof setImmediate !== 'undefined' && isNative(setImmediate)) {
  3006. // Fallback to setImmediate.
  3007. // Techinically it leverages the (macro) task queue,
  3008. // but it is still a better choice than setTimeout.
  3009. timerFunc = function () {
  3010. setImmediate(flushCallbacks);
  3011. };
  3012. } else {
  3013. // Fallback to setTimeout.
  3014. timerFunc = function () {
  3015. setTimeout(flushCallbacks, 0);
  3016. };
  3017. }
  3018. function nextTick (cb, ctx) {
  3019. var _resolve;
  3020. callbacks.push(function () {
  3021. if (cb) {
  3022. try {
  3023. cb.call(ctx);
  3024. } catch (e) {
  3025. handleError(e, ctx, 'nextTick');
  3026. }
  3027. } else if (_resolve) {
  3028. _resolve(ctx);
  3029. }
  3030. });
  3031. if (!pending) {
  3032. pending = true;
  3033. timerFunc();
  3034. }
  3035. // $flow-disable-line
  3036. if (!cb && typeof Promise !== 'undefined') {
  3037. return new Promise(function (resolve) {
  3038. _resolve = resolve;
  3039. })
  3040. }
  3041. }
  3042. /* */
  3043. /* not type checking this file because flow doesn't play well with Proxy */
  3044. var initProxy;
  3045. if (true) {
  3046. var allowedGlobals = makeMap(
  3047. 'Infinity,undefined,NaN,isFinite,isNaN,' +
  3048. 'parseFloat,parseInt,decodeURI,decodeURIComponent,encodeURI,encodeURIComponent,' +
  3049. 'Math,Number,Date,Array,Object,Boolean,String,RegExp,Map,Set,JSON,Intl,' +
  3050. 'require' // for Webpack/Browserify
  3051. );
  3052. var warnNonPresent = function (target, key) {
  3053. warn(
  3054. "Property or method \"" + key + "\" is not defined on the instance but " +
  3055. 'referenced during render. Make sure that this property is reactive, ' +
  3056. 'either in the data option, or for class-based components, by ' +
  3057. 'initializing the property. ' +
  3058. 'See: https://vuejs.org/v2/guide/reactivity.html#Declaring-Reactive-Properties.',
  3059. target
  3060. );
  3061. };
  3062. var warnReservedPrefix = function (target, key) {
  3063. warn(
  3064. "Property \"" + key + "\" must be accessed with \"$data." + key + "\" because " +
  3065. 'properties starting with "$" or "_" are not proxied in the Vue instance to ' +
  3066. 'prevent conflicts with Vue internals' +
  3067. 'See: https://vuejs.org/v2/api/#data',
  3068. target
  3069. );
  3070. };
  3071. var hasProxy =
  3072. typeof Proxy !== 'undefined' && isNative(Proxy);
  3073. if (hasProxy) {
  3074. var isBuiltInModifier = makeMap('stop,prevent,self,ctrl,shift,alt,meta,exact');
  3075. config.keyCodes = new Proxy(config.keyCodes, {
  3076. set: function set (target, key, value) {
  3077. if (isBuiltInModifier(key)) {
  3078. warn(("Avoid overwriting built-in modifier in config.keyCodes: ." + key));
  3079. return false
  3080. } else {
  3081. target[key] = value;
  3082. return true
  3083. }
  3084. }
  3085. });
  3086. }
  3087. var hasHandler = {
  3088. has: function has (target, key) {
  3089. var has = key in target;
  3090. var isAllowed = allowedGlobals(key) ||
  3091. (typeof key === 'string' && key.charAt(0) === '_' && !(key in target.$data));
  3092. if (!has && !isAllowed) {
  3093. if (key in target.$data) { warnReservedPrefix(target, key); }
  3094. else { warnNonPresent(target, key); }
  3095. }
  3096. return has || !isAllowed
  3097. }
  3098. };
  3099. var getHandler = {
  3100. get: function get (target, key) {
  3101. if (typeof key === 'string' && !(key in target)) {
  3102. if (key in target.$data) { warnReservedPrefix(target, key); }
  3103. else { warnNonPresent(target, key); }
  3104. }
  3105. return target[key]
  3106. }
  3107. };
  3108. initProxy = function initProxy (vm) {
  3109. if (hasProxy) {
  3110. // determine which proxy handler to use
  3111. var options = vm.$options;
  3112. var handlers = options.render && options.render._withStripped
  3113. ? getHandler
  3114. : hasHandler;
  3115. vm._renderProxy = new Proxy(vm, handlers);
  3116. } else {
  3117. vm._renderProxy = vm;
  3118. }
  3119. };
  3120. }
  3121. /* */
  3122. var seenObjects = new _Set();
  3123. /**
  3124. * Recursively traverse an object to evoke all converted
  3125. * getters, so that every nested property inside the object
  3126. * is collected as a "deep" dependency.
  3127. */
  3128. function traverse (val) {
  3129. _traverse(val, seenObjects);
  3130. seenObjects.clear();
  3131. }
  3132. function _traverse (val, seen) {
  3133. var i, keys;
  3134. var isA = Array.isArray(val);
  3135. if ((!isA && !isObject(val)) || Object.isFrozen(val) || val instanceof VNode) {
  3136. return
  3137. }
  3138. if (val.__ob__) {
  3139. var depId = val.__ob__.dep.id;
  3140. if (seen.has(depId)) {
  3141. return
  3142. }
  3143. seen.add(depId);
  3144. }
  3145. if (isA) {
  3146. i = val.length;
  3147. while (i--) { _traverse(val[i], seen); }
  3148. } else {
  3149. keys = Object.keys(val);
  3150. i = keys.length;
  3151. while (i--) { _traverse(val[keys[i]], seen); }
  3152. }
  3153. }
  3154. var mark;
  3155. var measure;
  3156. if (true) {
  3157. var perf = inBrowser && window.performance;
  3158. /* istanbul ignore if */
  3159. if (
  3160. perf &&
  3161. perf.mark &&
  3162. perf.measure &&
  3163. perf.clearMarks &&
  3164. perf.clearMeasures
  3165. ) {
  3166. mark = function (tag) { return perf.mark(tag); };
  3167. measure = function (name, startTag, endTag) {
  3168. perf.measure(name, startTag, endTag);
  3169. perf.clearMarks(startTag);
  3170. perf.clearMarks(endTag);
  3171. // perf.clearMeasures(name)
  3172. };
  3173. }
  3174. }
  3175. /* */
  3176. var normalizeEvent = cached(function (name) {
  3177. var passive = name.charAt(0) === '&';
  3178. name = passive ? name.slice(1) : name;
  3179. var once$$1 = name.charAt(0) === '~'; // Prefixed last, checked first
  3180. name = once$$1 ? name.slice(1) : name;
  3181. var capture = name.charAt(0) === '!';
  3182. name = capture ? name.slice(1) : name;
  3183. return {
  3184. name: name,
  3185. once: once$$1,
  3186. capture: capture,
  3187. passive: passive
  3188. }
  3189. });
  3190. function createFnInvoker (fns, vm) {
  3191. function invoker () {
  3192. var arguments$1 = arguments;
  3193. var fns = invoker.fns;
  3194. if (Array.isArray(fns)) {
  3195. var cloned = fns.slice();
  3196. for (var i = 0; i < cloned.length; i++) {
  3197. invokeWithErrorHandling(cloned[i], null, arguments$1, vm, "v-on handler");
  3198. }
  3199. } else {
  3200. // return handler return value for single handlers
  3201. return invokeWithErrorHandling(fns, null, arguments, vm, "v-on handler")
  3202. }
  3203. }
  3204. invoker.fns = fns;
  3205. return invoker
  3206. }
  3207. function updateListeners (
  3208. on,
  3209. oldOn,
  3210. add,
  3211. remove$$1,
  3212. createOnceHandler,
  3213. vm
  3214. ) {
  3215. var name, def$$1, cur, old, event;
  3216. for (name in on) {
  3217. def$$1 = cur = on[name];
  3218. old = oldOn[name];
  3219. event = normalizeEvent(name);
  3220. if (isUndef(cur)) {
  3221. true && warn(
  3222. "Invalid handler for event \"" + (event.name) + "\": got " + String(cur),
  3223. vm
  3224. );
  3225. } else if (isUndef(old)) {
  3226. if (isUndef(cur.fns)) {
  3227. cur = on[name] = createFnInvoker(cur, vm);
  3228. }
  3229. if (isTrue(event.once)) {
  3230. cur = on[name] = createOnceHandler(event.name, cur, event.capture);
  3231. }
  3232. add(event.name, cur, event.capture, event.passive, event.params);
  3233. } else if (cur !== old) {
  3234. old.fns = cur;
  3235. on[name] = old;
  3236. }
  3237. }
  3238. for (name in oldOn) {
  3239. if (isUndef(on[name])) {
  3240. event = normalizeEvent(name);
  3241. remove$$1(event.name, oldOn[name], event.capture);
  3242. }
  3243. }
  3244. }
  3245. /* */
  3246. /* */
  3247. function extractPropsFromVNodeData (
  3248. data,
  3249. Ctor,
  3250. tag
  3251. ) {
  3252. // we are only extracting raw values here.
  3253. // validation and default values are handled in the child
  3254. // component itself.
  3255. var propOptions = Ctor.options.props;
  3256. if (isUndef(propOptions)) {
  3257. return
  3258. }
  3259. var res = {};
  3260. var attrs = data.attrs;
  3261. var props = data.props;
  3262. if (isDef(attrs) || isDef(props)) {
  3263. for (var key in propOptions) {
  3264. var altKey = hyphenate(key);
  3265. if (true) {
  3266. var keyInLowerCase = key.toLowerCase();
  3267. if (
  3268. key !== keyInLowerCase &&
  3269. attrs && hasOwn(attrs, keyInLowerCase)
  3270. ) {
  3271. tip(
  3272. "Prop \"" + keyInLowerCase + "\" is passed to component " +
  3273. (formatComponentName(tag || Ctor)) + ", but the declared prop name is" +
  3274. " \"" + key + "\". " +
  3275. "Note that HTML attributes are case-insensitive and camelCased " +
  3276. "props need to use their kebab-case equivalents when using in-DOM " +
  3277. "templates. You should probably use \"" + altKey + "\" instead of \"" + key + "\"."
  3278. );
  3279. }
  3280. }
  3281. checkProp(res, props, key, altKey, true) ||
  3282. checkProp(res, attrs, key, altKey, false);
  3283. }
  3284. }
  3285. return res
  3286. }
  3287. function checkProp (
  3288. res,
  3289. hash,
  3290. key,
  3291. altKey,
  3292. preserve
  3293. ) {
  3294. if (isDef(hash)) {
  3295. if (hasOwn(hash, key)) {
  3296. res[key] = hash[key];
  3297. if (!preserve) {
  3298. delete hash[key];
  3299. }
  3300. return true
  3301. } else if (hasOwn(hash, altKey)) {
  3302. res[key] = hash[altKey];
  3303. if (!preserve) {
  3304. delete hash[altKey];
  3305. }
  3306. return true
  3307. }
  3308. }
  3309. return false
  3310. }
  3311. /* */
  3312. // The template compiler attempts to minimize the need for normalization by
  3313. // statically analyzing the template at compile time.
  3314. //
  3315. // For plain HTML markup, normalization can be completely skipped because the
  3316. // generated render function is guaranteed to return Array<VNode>. There are
  3317. // two cases where extra normalization is needed:
  3318. // 1. When the children contains components - because a functional component
  3319. // may return an Array instead of a single root. In this case, just a simple
  3320. // normalization is needed - if any child is an Array, we flatten the whole
  3321. // thing with Array.prototype.concat. It is guaranteed to be only 1-level deep
  3322. // because functional components already normalize their own children.
  3323. function simpleNormalizeChildren (children) {
  3324. for (var i = 0; i < children.length; i++) {
  3325. if (Array.isArray(children[i])) {
  3326. return Array.prototype.concat.apply([], children)
  3327. }
  3328. }
  3329. return children
  3330. }
  3331. // 2. When the children contains constructs that always generated nested Arrays,
  3332. // e.g. <template>, <slot>, v-for, or when the children is provided by user
  3333. // with hand-written render functions / JSX. In such cases a full normalization
  3334. // is needed to cater to all possible types of children values.
  3335. function normalizeChildren (children) {
  3336. return isPrimitive(children)
  3337. ? [createTextVNode(children)]
  3338. : Array.isArray(children)
  3339. ? normalizeArrayChildren(children)
  3340. : undefined
  3341. }
  3342. function isTextNode (node) {
  3343. return isDef(node) && isDef(node.text) && isFalse(node.isComment)
  3344. }
  3345. function normalizeArrayChildren (children, nestedIndex) {
  3346. var res = [];
  3347. var i, c, lastIndex, last;
  3348. for (i = 0; i < children.length; i++) {
  3349. c = children[i];
  3350. if (isUndef(c) || typeof c === 'boolean') { continue }
  3351. lastIndex = res.length - 1;
  3352. last = res[lastIndex];
  3353. // nested
  3354. if (Array.isArray(c)) {
  3355. if (c.length > 0) {
  3356. c = normalizeArrayChildren(c, ((nestedIndex || '') + "_" + i));
  3357. // merge adjacent text nodes
  3358. if (isTextNode(c[0]) && isTextNode(last)) {
  3359. res[lastIndex] = createTextVNode(last.text + (c[0]).text);
  3360. c.shift();
  3361. }
  3362. res.push.apply(res, c);
  3363. }
  3364. } else if (isPrimitive(c)) {
  3365. if (isTextNode(last)) {
  3366. // merge adjacent text nodes
  3367. // this is necessary for SSR hydration because text nodes are
  3368. // essentially merged when rendered to HTML strings
  3369. res[lastIndex] = createTextVNode(last.text + c);
  3370. } else if (c !== '') {
  3371. // convert primitive to vnode
  3372. res.push(createTextVNode(c));
  3373. }
  3374. } else {
  3375. if (isTextNode(c) && isTextNode(last)) {
  3376. // merge adjacent text nodes
  3377. res[lastIndex] = createTextVNode(last.text + c.text);
  3378. } else {
  3379. // default key for nested array children (likely generated by v-for)
  3380. if (isTrue(children._isVList) &&
  3381. isDef(c.tag) &&
  3382. isUndef(c.key) &&
  3383. isDef(nestedIndex)) {
  3384. c.key = "__vlist" + nestedIndex + "_" + i + "__";
  3385. }
  3386. res.push(c);
  3387. }
  3388. }
  3389. }
  3390. return res
  3391. }
  3392. /* */
  3393. function initProvide (vm) {
  3394. var provide = vm.$options.provide;
  3395. if (provide) {
  3396. vm._provided = typeof provide === 'function'
  3397. ? provide.call(vm)
  3398. : provide;
  3399. }
  3400. }
  3401. function initInjections (vm) {
  3402. var result = resolveInject(vm.$options.inject, vm);
  3403. if (result) {
  3404. toggleObserving(false);
  3405. Object.keys(result).forEach(function (key) {
  3406. /* istanbul ignore else */
  3407. if (true) {
  3408. defineReactive$$1(vm, key, result[key], function () {
  3409. warn(
  3410. "Avoid mutating an injected value directly since the changes will be " +
  3411. "overwritten whenever the provided component re-renders. " +
  3412. "injection being mutated: \"" + key + "\"",
  3413. vm
  3414. );
  3415. });
  3416. } else {}
  3417. });
  3418. toggleObserving(true);
  3419. }
  3420. }
  3421. function resolveInject (inject, vm) {
  3422. if (inject) {
  3423. // inject is :any because flow is not smart enough to figure out cached
  3424. var result = Object.create(null);
  3425. var keys = hasSymbol
  3426. ? Reflect.ownKeys(inject)
  3427. : Object.keys(inject);
  3428. for (var i = 0; i < keys.length; i++) {
  3429. var key = keys[i];
  3430. // #6574 in case the inject object is observed...
  3431. if (key === '__ob__') { continue }
  3432. var provideKey = inject[key].from;
  3433. var source = vm;
  3434. while (source) {
  3435. if (source._provided && hasOwn(source._provided, provideKey)) {
  3436. result[key] = source._provided[provideKey];
  3437. break
  3438. }
  3439. source = source.$parent;
  3440. }
  3441. if (!source) {
  3442. if ('default' in inject[key]) {
  3443. var provideDefault = inject[key].default;
  3444. result[key] = typeof provideDefault === 'function'
  3445. ? provideDefault.call(vm)
  3446. : provideDefault;
  3447. } else if (true) {
  3448. warn(("Injection \"" + key + "\" not found"), vm);
  3449. }
  3450. }
  3451. }
  3452. return result
  3453. }
  3454. }
  3455. /* */
  3456. /**
  3457. * Runtime helper for resolving raw children VNodes into a slot object.
  3458. */
  3459. function resolveSlots (
  3460. children,
  3461. context
  3462. ) {
  3463. if (!children || !children.length) {
  3464. return {}
  3465. }
  3466. var slots = {};
  3467. for (var i = 0, l = children.length; i < l; i++) {
  3468. var child = children[i];
  3469. var data = child.data;
  3470. // remove slot attribute if the node is resolved as a Vue slot node
  3471. if (data && data.attrs && data.attrs.slot) {
  3472. delete data.attrs.slot;
  3473. }
  3474. // named slots should only be respected if the vnode was rendered in the
  3475. // same context.
  3476. if ((child.context === context || child.fnContext === context) &&
  3477. data && data.slot != null
  3478. ) {
  3479. var name = data.slot;
  3480. var slot = (slots[name] || (slots[name] = []));
  3481. if (child.tag === 'template') {
  3482. slot.push.apply(slot, child.children || []);
  3483. } else {
  3484. slot.push(child);
  3485. }
  3486. } else {
  3487. (slots.default || (slots.default = [])).push(child);
  3488. }
  3489. }
  3490. // ignore slots that contains only whitespace
  3491. for (var name$1 in slots) {
  3492. if (slots[name$1].every(isWhitespace)) {
  3493. delete slots[name$1];
  3494. }
  3495. }
  3496. return slots
  3497. }
  3498. function isWhitespace (node) {
  3499. return (node.isComment && !node.asyncFactory) || node.text === ' '
  3500. }
  3501. /* */
  3502. function normalizeScopedSlots (
  3503. slots,
  3504. normalSlots,
  3505. prevSlots
  3506. ) {
  3507. var res;
  3508. var hasNormalSlots = Object.keys(normalSlots).length > 0;
  3509. var isStable = slots ? !!slots.$stable : !hasNormalSlots;
  3510. var key = slots && slots.$key;
  3511. if (!slots) {
  3512. res = {};
  3513. } else if (slots._normalized) {
  3514. // fast path 1: child component re-render only, parent did not change
  3515. return slots._normalized
  3516. } else if (
  3517. isStable &&
  3518. prevSlots &&
  3519. prevSlots !== emptyObject &&
  3520. key === prevSlots.$key &&
  3521. !hasNormalSlots &&
  3522. !prevSlots.$hasNormal
  3523. ) {
  3524. // fast path 2: stable scoped slots w/ no normal slots to proxy,
  3525. // only need to normalize once
  3526. return prevSlots
  3527. } else {
  3528. res = {};
  3529. for (var key$1 in slots) {
  3530. if (slots[key$1] && key$1[0] !== '$') {
  3531. res[key$1] = normalizeScopedSlot(normalSlots, key$1, slots[key$1]);
  3532. }
  3533. }
  3534. }
  3535. // expose normal slots on scopedSlots
  3536. for (var key$2 in normalSlots) {
  3537. if (!(key$2 in res)) {
  3538. res[key$2] = proxyNormalSlot(normalSlots, key$2);
  3539. }
  3540. }
  3541. // avoriaz seems to mock a non-extensible $scopedSlots object
  3542. // and when that is passed down this would cause an error
  3543. if (slots && Object.isExtensible(slots)) {
  3544. (slots)._normalized = res;
  3545. }
  3546. def(res, '$stable', isStable);
  3547. def(res, '$key', key);
  3548. def(res, '$hasNormal', hasNormalSlots);
  3549. return res
  3550. }
  3551. function normalizeScopedSlot(normalSlots, key, fn) {
  3552. var normalized = function () {
  3553. var res = arguments.length ? fn.apply(null, arguments) : fn({});
  3554. res = res && typeof res === 'object' && !Array.isArray(res)
  3555. ? [res] // single vnode
  3556. : normalizeChildren(res);
  3557. return res && (
  3558. res.length === 0 ||
  3559. (res.length === 1 && res[0].isComment) // #9658
  3560. ) ? undefined
  3561. : res
  3562. };
  3563. // this is a slot using the new v-slot syntax without scope. although it is
  3564. // compiled as a scoped slot, render fn users would expect it to be present
  3565. // on this.$slots because the usage is semantically a normal slot.
  3566. if (fn.proxy) {
  3567. Object.defineProperty(normalSlots, key, {
  3568. get: normalized,
  3569. enumerable: true,
  3570. configurable: true
  3571. });
  3572. }
  3573. return normalized
  3574. }
  3575. function proxyNormalSlot(slots, key) {
  3576. return function () { return slots[key]; }
  3577. }
  3578. /* */
  3579. /**
  3580. * Runtime helper for rendering v-for lists.
  3581. */
  3582. function renderList (
  3583. val,
  3584. render
  3585. ) {
  3586. var ret, i, l, keys, key;
  3587. if (Array.isArray(val) || typeof val === 'string') {
  3588. ret = new Array(val.length);
  3589. for (i = 0, l = val.length; i < l; i++) {
  3590. ret[i] = render(val[i], i);
  3591. }
  3592. } else if (typeof val === 'number') {
  3593. ret = new Array(val);
  3594. for (i = 0; i < val; i++) {
  3595. ret[i] = render(i + 1, i);
  3596. }
  3597. } else if (isObject(val)) {
  3598. if (hasSymbol && val[Symbol.iterator]) {
  3599. ret = [];
  3600. var iterator = val[Symbol.iterator]();
  3601. var result = iterator.next();
  3602. while (!result.done) {
  3603. ret.push(render(result.value, ret.length));
  3604. result = iterator.next();
  3605. }
  3606. } else {
  3607. keys = Object.keys(val);
  3608. ret = new Array(keys.length);
  3609. for (i = 0, l = keys.length; i < l; i++) {
  3610. key = keys[i];
  3611. ret[i] = render(val[key], key, i);
  3612. }
  3613. }
  3614. }
  3615. if (!isDef(ret)) {
  3616. ret = [];
  3617. }
  3618. (ret)._isVList = true;
  3619. return ret
  3620. }
  3621. /* */
  3622. /**
  3623. * Runtime helper for rendering <slot>
  3624. */
  3625. function renderSlot (
  3626. name,
  3627. fallback,
  3628. props,
  3629. bindObject
  3630. ) {
  3631. var scopedSlotFn = this.$scopedSlots[name];
  3632. var nodes;
  3633. if (scopedSlotFn) { // scoped slot
  3634. props = props || {};
  3635. if (bindObject) {
  3636. if ( true && !isObject(bindObject)) {
  3637. warn(
  3638. 'slot v-bind without argument expects an Object',
  3639. this
  3640. );
  3641. }
  3642. props = extend(extend({}, bindObject), props);
  3643. }
  3644. nodes = scopedSlotFn(props) || fallback;
  3645. } else {
  3646. nodes = this.$slots[name] || fallback;
  3647. }
  3648. var target = props && props.slot;
  3649. if (target) {
  3650. return this.$createElement('template', { slot: target }, nodes)
  3651. } else {
  3652. return nodes
  3653. }
  3654. }
  3655. /* */
  3656. /**
  3657. * Runtime helper for resolving filters
  3658. */
  3659. function resolveFilter (id) {
  3660. return resolveAsset(this.$options, 'filters', id, true) || identity
  3661. }
  3662. /* */
  3663. function isKeyNotMatch (expect, actual) {
  3664. if (Array.isArray(expect)) {
  3665. return expect.indexOf(actual) === -1
  3666. } else {
  3667. return expect !== actual
  3668. }
  3669. }
  3670. /**
  3671. * Runtime helper for checking keyCodes from config.
  3672. * exposed as Vue.prototype._k
  3673. * passing in eventKeyName as last argument separately for backwards compat
  3674. */
  3675. function checkKeyCodes (
  3676. eventKeyCode,
  3677. key,
  3678. builtInKeyCode,
  3679. eventKeyName,
  3680. builtInKeyName
  3681. ) {
  3682. var mappedKeyCode = config.keyCodes[key] || builtInKeyCode;
  3683. if (builtInKeyName && eventKeyName && !config.keyCodes[key]) {
  3684. return isKeyNotMatch(builtInKeyName, eventKeyName)
  3685. } else if (mappedKeyCode) {
  3686. return isKeyNotMatch(mappedKeyCode, eventKeyCode)
  3687. } else if (eventKeyName) {
  3688. return hyphenate(eventKeyName) !== key
  3689. }
  3690. }
  3691. /* */
  3692. /**
  3693. * Runtime helper for merging v-bind="object" into a VNode's data.
  3694. */
  3695. function bindObjectProps (
  3696. data,
  3697. tag,
  3698. value,
  3699. asProp,
  3700. isSync
  3701. ) {
  3702. if (value) {
  3703. if (!isObject(value)) {
  3704. true && warn(
  3705. 'v-bind without argument expects an Object or Array value',
  3706. this
  3707. );
  3708. } else {
  3709. if (Array.isArray(value)) {
  3710. value = toObject(value);
  3711. }
  3712. var hash;
  3713. var loop = function ( key ) {
  3714. if (
  3715. key === 'class' ||
  3716. key === 'style' ||
  3717. isReservedAttribute(key)
  3718. ) {
  3719. hash = data;
  3720. } else {
  3721. var type = data.attrs && data.attrs.type;
  3722. hash = asProp || config.mustUseProp(tag, type, key)
  3723. ? data.domProps || (data.domProps = {})
  3724. : data.attrs || (data.attrs = {});
  3725. }
  3726. var camelizedKey = camelize(key);
  3727. var hyphenatedKey = hyphenate(key);
  3728. if (!(camelizedKey in hash) && !(hyphenatedKey in hash)) {
  3729. hash[key] = value[key];
  3730. if (isSync) {
  3731. var on = data.on || (data.on = {});
  3732. on[("update:" + key)] = function ($event) {
  3733. value[key] = $event;
  3734. };
  3735. }
  3736. }
  3737. };
  3738. for (var key in value) loop( key );
  3739. }
  3740. }
  3741. return data
  3742. }
  3743. /* */
  3744. /**
  3745. * Runtime helper for rendering static trees.
  3746. */
  3747. function renderStatic (
  3748. index,
  3749. isInFor
  3750. ) {
  3751. var cached = this._staticTrees || (this._staticTrees = []);
  3752. var tree = cached[index];
  3753. // if has already-rendered static tree and not inside v-for,
  3754. // we can reuse the same tree.
  3755. if (tree && !isInFor) {
  3756. return tree
  3757. }
  3758. // otherwise, render a fresh tree.
  3759. tree = cached[index] = this.$options.staticRenderFns[index].call(
  3760. this._renderProxy,
  3761. null,
  3762. this // for render fns generated for functional component templates
  3763. );
  3764. markStatic(tree, ("__static__" + index), false);
  3765. return tree
  3766. }
  3767. /**
  3768. * Runtime helper for v-once.
  3769. * Effectively it means marking the node as static with a unique key.
  3770. */
  3771. function markOnce (
  3772. tree,
  3773. index,
  3774. key
  3775. ) {
  3776. markStatic(tree, ("__once__" + index + (key ? ("_" + key) : "")), true);
  3777. return tree
  3778. }
  3779. function markStatic (
  3780. tree,
  3781. key,
  3782. isOnce
  3783. ) {
  3784. if (Array.isArray(tree)) {
  3785. for (var i = 0; i < tree.length; i++) {
  3786. if (tree[i] && typeof tree[i] !== 'string') {
  3787. markStaticNode(tree[i], (key + "_" + i), isOnce);
  3788. }
  3789. }
  3790. } else {
  3791. markStaticNode(tree, key, isOnce);
  3792. }
  3793. }
  3794. function markStaticNode (node, key, isOnce) {
  3795. node.isStatic = true;
  3796. node.key = key;
  3797. node.isOnce = isOnce;
  3798. }
  3799. /* */
  3800. function bindObjectListeners (data, value) {
  3801. if (value) {
  3802. if (!isPlainObject(value)) {
  3803. true && warn(
  3804. 'v-on without argument expects an Object value',
  3805. this
  3806. );
  3807. } else {
  3808. var on = data.on = data.on ? extend({}, data.on) : {};
  3809. for (var key in value) {
  3810. var existing = on[key];
  3811. var ours = value[key];
  3812. on[key] = existing ? [].concat(existing, ours) : ours;
  3813. }
  3814. }
  3815. }
  3816. return data
  3817. }
  3818. /* */
  3819. function resolveScopedSlots (
  3820. fns, // see flow/vnode
  3821. res,
  3822. // the following are added in 2.6
  3823. hasDynamicKeys,
  3824. contentHashKey
  3825. ) {
  3826. res = res || { $stable: !hasDynamicKeys };
  3827. for (var i = 0; i < fns.length; i++) {
  3828. var slot = fns[i];
  3829. if (Array.isArray(slot)) {
  3830. resolveScopedSlots(slot, res, hasDynamicKeys);
  3831. } else if (slot) {
  3832. // marker for reverse proxying v-slot without scope on this.$slots
  3833. if (slot.proxy) {
  3834. slot.fn.proxy = true;
  3835. }
  3836. res[slot.key] = slot.fn;
  3837. }
  3838. }
  3839. if (contentHashKey) {
  3840. (res).$key = contentHashKey;
  3841. }
  3842. return res
  3843. }
  3844. /* */
  3845. function bindDynamicKeys (baseObj, values) {
  3846. for (var i = 0; i < values.length; i += 2) {
  3847. var key = values[i];
  3848. if (typeof key === 'string' && key) {
  3849. baseObj[values[i]] = values[i + 1];
  3850. } else if ( true && key !== '' && key !== null) {
  3851. // null is a speical value for explicitly removing a binding
  3852. warn(
  3853. ("Invalid value for dynamic directive argument (expected string or null): " + key),
  3854. this
  3855. );
  3856. }
  3857. }
  3858. return baseObj
  3859. }
  3860. // helper to dynamically append modifier runtime markers to event names.
  3861. // ensure only append when value is already string, otherwise it will be cast
  3862. // to string and cause the type check to miss.
  3863. function prependModifier (value, symbol) {
  3864. return typeof value === 'string' ? symbol + value : value
  3865. }
  3866. /* */
  3867. function installRenderHelpers (target) {
  3868. target._o = markOnce;
  3869. target._n = toNumber;
  3870. target._s = toString;
  3871. target._l = renderList;
  3872. target._t = renderSlot;
  3873. target._q = looseEqual;
  3874. target._i = looseIndexOf;
  3875. target._m = renderStatic;
  3876. target._f = resolveFilter;
  3877. target._k = checkKeyCodes;
  3878. target._b = bindObjectProps;
  3879. target._v = createTextVNode;
  3880. target._e = createEmptyVNode;
  3881. target._u = resolveScopedSlots;
  3882. target._g = bindObjectListeners;
  3883. target._d = bindDynamicKeys;
  3884. target._p = prependModifier;
  3885. }
  3886. /* */
  3887. function FunctionalRenderContext (
  3888. data,
  3889. props,
  3890. children,
  3891. parent,
  3892. Ctor
  3893. ) {
  3894. var this$1 = this;
  3895. var options = Ctor.options;
  3896. // ensure the createElement function in functional components
  3897. // gets a unique context - this is necessary for correct named slot check
  3898. var contextVm;
  3899. if (hasOwn(parent, '_uid')) {
  3900. contextVm = Object.create(parent);
  3901. // $flow-disable-line
  3902. contextVm._original = parent;
  3903. } else {
  3904. // the context vm passed in is a functional context as well.
  3905. // in this case we want to make sure we are able to get a hold to the
  3906. // real context instance.
  3907. contextVm = parent;
  3908. // $flow-disable-line
  3909. parent = parent._original;
  3910. }
  3911. var isCompiled = isTrue(options._compiled);
  3912. var needNormalization = !isCompiled;
  3913. this.data = data;
  3914. this.props = props;
  3915. this.children = children;
  3916. this.parent = parent;
  3917. this.listeners = data.on || emptyObject;
  3918. this.injections = resolveInject(options.inject, parent);
  3919. this.slots = function () {
  3920. if (!this$1.$slots) {
  3921. normalizeScopedSlots(
  3922. data.scopedSlots,
  3923. this$1.$slots = resolveSlots(children, parent)
  3924. );
  3925. }
  3926. return this$1.$slots
  3927. };
  3928. Object.defineProperty(this, 'scopedSlots', ({
  3929. enumerable: true,
  3930. get: function get () {
  3931. return normalizeScopedSlots(data.scopedSlots, this.slots())
  3932. }
  3933. }));
  3934. // support for compiled functional template
  3935. if (isCompiled) {
  3936. // exposing $options for renderStatic()
  3937. this.$options = options;
  3938. // pre-resolve slots for renderSlot()
  3939. this.$slots = this.slots();
  3940. this.$scopedSlots = normalizeScopedSlots(data.scopedSlots, this.$slots);
  3941. }
  3942. if (options._scopeId) {
  3943. this._c = function (a, b, c, d) {
  3944. var vnode = createElement(contextVm, a, b, c, d, needNormalization);
  3945. if (vnode && !Array.isArray(vnode)) {
  3946. vnode.fnScopeId = options._scopeId;
  3947. vnode.fnContext = parent;
  3948. }
  3949. return vnode
  3950. };
  3951. } else {
  3952. this._c = function (a, b, c, d) { return createElement(contextVm, a, b, c, d, needNormalization); };
  3953. }
  3954. }
  3955. installRenderHelpers(FunctionalRenderContext.prototype);
  3956. function createFunctionalComponent (
  3957. Ctor,
  3958. propsData,
  3959. data,
  3960. contextVm,
  3961. children
  3962. ) {
  3963. var options = Ctor.options;
  3964. var props = {};
  3965. var propOptions = options.props;
  3966. if (isDef(propOptions)) {
  3967. for (var key in propOptions) {
  3968. props[key] = validateProp(key, propOptions, propsData || emptyObject);
  3969. }
  3970. } else {
  3971. if (isDef(data.attrs)) { mergeProps(props, data.attrs); }
  3972. if (isDef(data.props)) { mergeProps(props, data.props); }
  3973. }
  3974. var renderContext = new FunctionalRenderContext(
  3975. data,
  3976. props,
  3977. children,
  3978. contextVm,
  3979. Ctor
  3980. );
  3981. var vnode = options.render.call(null, renderContext._c, renderContext);
  3982. if (vnode instanceof VNode) {
  3983. return cloneAndMarkFunctionalResult(vnode, data, renderContext.parent, options, renderContext)
  3984. } else if (Array.isArray(vnode)) {
  3985. var vnodes = normalizeChildren(vnode) || [];
  3986. var res = new Array(vnodes.length);
  3987. for (var i = 0; i < vnodes.length; i++) {
  3988. res[i] = cloneAndMarkFunctionalResult(vnodes[i], data, renderContext.parent, options, renderContext);
  3989. }
  3990. return res
  3991. }
  3992. }
  3993. function cloneAndMarkFunctionalResult (vnode, data, contextVm, options, renderContext) {
  3994. // #7817 clone node before setting fnContext, otherwise if the node is reused
  3995. // (e.g. it was from a cached normal slot) the fnContext causes named slots
  3996. // that should not be matched to match.
  3997. var clone = cloneVNode(vnode);
  3998. clone.fnContext = contextVm;
  3999. clone.fnOptions = options;
  4000. if (true) {
  4001. (clone.devtoolsMeta = clone.devtoolsMeta || {}).renderContext = renderContext;
  4002. }
  4003. if (data.slot) {
  4004. (clone.data || (clone.data = {})).slot = data.slot;
  4005. }
  4006. return clone
  4007. }
  4008. function mergeProps (to, from) {
  4009. for (var key in from) {
  4010. to[camelize(key)] = from[key];
  4011. }
  4012. }
  4013. /* */
  4014. /* */
  4015. /* */
  4016. /* */
  4017. // inline hooks to be invoked on component VNodes during patch
  4018. var componentVNodeHooks = {
  4019. init: function init (vnode, hydrating) {
  4020. if (
  4021. vnode.componentInstance &&
  4022. !vnode.componentInstance._isDestroyed &&
  4023. vnode.data.keepAlive
  4024. ) {
  4025. // kept-alive components, treat as a patch
  4026. var mountedNode = vnode; // work around flow
  4027. componentVNodeHooks.prepatch(mountedNode, mountedNode);
  4028. } else {
  4029. var child = vnode.componentInstance = createComponentInstanceForVnode(
  4030. vnode,
  4031. activeInstance
  4032. );
  4033. child.$mount(hydrating ? vnode.elm : undefined, hydrating);
  4034. }
  4035. },
  4036. prepatch: function prepatch (oldVnode, vnode) {
  4037. var options = vnode.componentOptions;
  4038. var child = vnode.componentInstance = oldVnode.componentInstance;
  4039. updateChildComponent(
  4040. child,
  4041. options.propsData, // updated props
  4042. options.listeners, // updated listeners
  4043. vnode, // new parent vnode
  4044. options.children // new children
  4045. );
  4046. },
  4047. insert: function insert (vnode) {
  4048. var context = vnode.context;
  4049. var componentInstance = vnode.componentInstance;
  4050. if (!componentInstance._isMounted) {
  4051. componentInstance._isMounted = true;
  4052. callHook(componentInstance, 'mounted');
  4053. }
  4054. if (vnode.data.keepAlive) {
  4055. if (context._isMounted) {
  4056. // vue-router#1212
  4057. // During updates, a kept-alive component's child components may
  4058. // change, so directly walking the tree here may call activated hooks
  4059. // on incorrect children. Instead we push them into a queue which will
  4060. // be processed after the whole patch process ended.
  4061. queueActivatedComponent(componentInstance);
  4062. } else {
  4063. activateChildComponent(componentInstance, true /* direct */);
  4064. }
  4065. }
  4066. },
  4067. destroy: function destroy (vnode) {
  4068. var componentInstance = vnode.componentInstance;
  4069. if (!componentInstance._isDestroyed) {
  4070. if (!vnode.data.keepAlive) {
  4071. componentInstance.$destroy();
  4072. } else {
  4073. deactivateChildComponent(componentInstance, true /* direct */);
  4074. }
  4075. }
  4076. }
  4077. };
  4078. var hooksToMerge = Object.keys(componentVNodeHooks);
  4079. function createComponent (
  4080. Ctor,
  4081. data,
  4082. context,
  4083. children,
  4084. tag
  4085. ) {
  4086. if (isUndef(Ctor)) {
  4087. return
  4088. }
  4089. var baseCtor = context.$options._base;
  4090. // plain options object: turn it into a constructor
  4091. if (isObject(Ctor)) {
  4092. Ctor = baseCtor.extend(Ctor);
  4093. }
  4094. // if at this stage it's not a constructor or an async component factory,
  4095. // reject.
  4096. if (typeof Ctor !== 'function') {
  4097. if (true) {
  4098. warn(("Invalid Component definition: " + (String(Ctor))), context);
  4099. }
  4100. return
  4101. }
  4102. // async component
  4103. var asyncFactory;
  4104. if (isUndef(Ctor.cid)) {
  4105. asyncFactory = Ctor;
  4106. Ctor = resolveAsyncComponent(asyncFactory, baseCtor);
  4107. if (Ctor === undefined) {
  4108. // return a placeholder node for async component, which is rendered
  4109. // as a comment node but preserves all the raw information for the node.
  4110. // the information will be used for async server-rendering and hydration.
  4111. return createAsyncPlaceholder(
  4112. asyncFactory,
  4113. data,
  4114. context,
  4115. children,
  4116. tag
  4117. )
  4118. }
  4119. }
  4120. data = data || {};
  4121. // resolve constructor options in case global mixins are applied after
  4122. // component constructor creation
  4123. resolveConstructorOptions(Ctor);
  4124. // transform component v-model data into props & events
  4125. if (isDef(data.model)) {
  4126. transformModel(Ctor.options, data);
  4127. }
  4128. // extract props
  4129. var propsData = extractPropsFromVNodeData(data, Ctor, tag);
  4130. // functional component
  4131. if (isTrue(Ctor.options.functional)) {
  4132. return createFunctionalComponent(Ctor, propsData, data, context, children)
  4133. }
  4134. // extract listeners, since these needs to be treated as
  4135. // child component listeners instead of DOM listeners
  4136. var listeners = data.on;
  4137. // replace with listeners with .native modifier
  4138. // so it gets processed during parent component patch.
  4139. data.on = data.nativeOn;
  4140. if (isTrue(Ctor.options.abstract)) {
  4141. // abstract components do not keep anything
  4142. // other than props & listeners & slot
  4143. // work around flow
  4144. var slot = data.slot;
  4145. data = {};
  4146. if (slot) {
  4147. data.slot = slot;
  4148. }
  4149. }
  4150. // install component management hooks onto the placeholder node
  4151. installComponentHooks(data);
  4152. // return a placeholder vnode
  4153. var name = Ctor.options.name || tag;
  4154. var vnode = new VNode(
  4155. ("vue-component-" + (Ctor.cid) + (name ? ("-" + name) : '')),
  4156. data, undefined, undefined, undefined, context,
  4157. { Ctor: Ctor, propsData: propsData, listeners: listeners, tag: tag, children: children },
  4158. asyncFactory
  4159. );
  4160. return vnode
  4161. }
  4162. function createComponentInstanceForVnode (
  4163. vnode, // we know it's MountedComponentVNode but flow doesn't
  4164. parent // activeInstance in lifecycle state
  4165. ) {
  4166. var options = {
  4167. _isComponent: true,
  4168. _parentVnode: vnode,
  4169. parent: parent
  4170. };
  4171. // check inline-template render functions
  4172. var inlineTemplate = vnode.data.inlineTemplate;
  4173. if (isDef(inlineTemplate)) {
  4174. options.render = inlineTemplate.render;
  4175. options.staticRenderFns = inlineTemplate.staticRenderFns;
  4176. }
  4177. return new vnode.componentOptions.Ctor(options)
  4178. }
  4179. function installComponentHooks (data) {
  4180. var hooks = data.hook || (data.hook = {});
  4181. for (var i = 0; i < hooksToMerge.length; i++) {
  4182. var key = hooksToMerge[i];
  4183. var existing = hooks[key];
  4184. var toMerge = componentVNodeHooks[key];
  4185. if (existing !== toMerge && !(existing && existing._merged)) {
  4186. hooks[key] = existing ? mergeHook$1(toMerge, existing) : toMerge;
  4187. }
  4188. }
  4189. }
  4190. function mergeHook$1 (f1, f2) {
  4191. var merged = function (a, b) {
  4192. // flow complains about extra args which is why we use any
  4193. f1(a, b);
  4194. f2(a, b);
  4195. };
  4196. merged._merged = true;
  4197. return merged
  4198. }
  4199. // transform component v-model info (value and callback) into
  4200. // prop and event handler respectively.
  4201. function transformModel (options, data) {
  4202. var prop = (options.model && options.model.prop) || 'value';
  4203. var event = (options.model && options.model.event) || 'input'
  4204. ;(data.attrs || (data.attrs = {}))[prop] = data.model.value;
  4205. var on = data.on || (data.on = {});
  4206. var existing = on[event];
  4207. var callback = data.model.callback;
  4208. if (isDef(existing)) {
  4209. if (
  4210. Array.isArray(existing)
  4211. ? existing.indexOf(callback) === -1
  4212. : existing !== callback
  4213. ) {
  4214. on[event] = [callback].concat(existing);
  4215. }
  4216. } else {
  4217. on[event] = callback;
  4218. }
  4219. }
  4220. /* */
  4221. var SIMPLE_NORMALIZE = 1;
  4222. var ALWAYS_NORMALIZE = 2;
  4223. // wrapper function for providing a more flexible interface
  4224. // without getting yelled at by flow
  4225. function createElement (
  4226. context,
  4227. tag,
  4228. data,
  4229. children,
  4230. normalizationType,
  4231. alwaysNormalize
  4232. ) {
  4233. if (Array.isArray(data) || isPrimitive(data)) {
  4234. normalizationType = children;
  4235. children = data;
  4236. data = undefined;
  4237. }
  4238. if (isTrue(alwaysNormalize)) {
  4239. normalizationType = ALWAYS_NORMALIZE;
  4240. }
  4241. return _createElement(context, tag, data, children, normalizationType)
  4242. }
  4243. function _createElement (
  4244. context,
  4245. tag,
  4246. data,
  4247. children,
  4248. normalizationType
  4249. ) {
  4250. if (isDef(data) && isDef((data).__ob__)) {
  4251. true && warn(
  4252. "Avoid using observed data object as vnode data: " + (JSON.stringify(data)) + "\n" +
  4253. 'Always create fresh vnode data objects in each render!',
  4254. context
  4255. );
  4256. return createEmptyVNode()
  4257. }
  4258. // object syntax in v-bind
  4259. if (isDef(data) && isDef(data.is)) {
  4260. tag = data.is;
  4261. }
  4262. if (!tag) {
  4263. // in case of component :is set to falsy value
  4264. return createEmptyVNode()
  4265. }
  4266. // warn against non-primitive key
  4267. if ( true &&
  4268. isDef(data) && isDef(data.key) && !isPrimitive(data.key)
  4269. ) {
  4270. {
  4271. warn(
  4272. 'Avoid using non-primitive value as key, ' +
  4273. 'use string/number value instead.',
  4274. context
  4275. );
  4276. }
  4277. }
  4278. // support single function children as default scoped slot
  4279. if (Array.isArray(children) &&
  4280. typeof children[0] === 'function'
  4281. ) {
  4282. data = data || {};
  4283. data.scopedSlots = { default: children[0] };
  4284. children.length = 0;
  4285. }
  4286. if (normalizationType === ALWAYS_NORMALIZE) {
  4287. children = normalizeChildren(children);
  4288. } else if (normalizationType === SIMPLE_NORMALIZE) {
  4289. children = simpleNormalizeChildren(children);
  4290. }
  4291. var vnode, ns;
  4292. if (typeof tag === 'string') {
  4293. var Ctor;
  4294. ns = (context.$vnode && context.$vnode.ns) || config.getTagNamespace(tag);
  4295. if (config.isReservedTag(tag)) {
  4296. // platform built-in elements
  4297. vnode = new VNode(
  4298. config.parsePlatformTagName(tag), data, children,
  4299. undefined, undefined, context
  4300. );
  4301. } else if ((!data || !data.pre) && isDef(Ctor = resolveAsset(context.$options, 'components', tag))) {
  4302. // component
  4303. vnode = createComponent(Ctor, data, context, children, tag);
  4304. } else {
  4305. // unknown or unlisted namespaced elements
  4306. // check at runtime because it may get assigned a namespace when its
  4307. // parent normalizes children
  4308. vnode = new VNode(
  4309. tag, data, children,
  4310. undefined, undefined, context
  4311. );
  4312. }
  4313. } else {
  4314. // direct component options / constructor
  4315. vnode = createComponent(tag, data, context, children);
  4316. }
  4317. if (Array.isArray(vnode)) {
  4318. return vnode
  4319. } else if (isDef(vnode)) {
  4320. if (isDef(ns)) { applyNS(vnode, ns); }
  4321. if (isDef(data)) { registerDeepBindings(data); }
  4322. return vnode
  4323. } else {
  4324. return createEmptyVNode()
  4325. }
  4326. }
  4327. function applyNS (vnode, ns, force) {
  4328. vnode.ns = ns;
  4329. if (vnode.tag === 'foreignObject') {
  4330. // use default namespace inside foreignObject
  4331. ns = undefined;
  4332. force = true;
  4333. }
  4334. if (isDef(vnode.children)) {
  4335. for (var i = 0, l = vnode.children.length; i < l; i++) {
  4336. var child = vnode.children[i];
  4337. if (isDef(child.tag) && (
  4338. isUndef(child.ns) || (isTrue(force) && child.tag !== 'svg'))) {
  4339. applyNS(child, ns, force);
  4340. }
  4341. }
  4342. }
  4343. }
  4344. // ref #5318
  4345. // necessary to ensure parent re-render when deep bindings like :style and
  4346. // :class are used on slot nodes
  4347. function registerDeepBindings (data) {
  4348. if (isObject(data.style)) {
  4349. traverse(data.style);
  4350. }
  4351. if (isObject(data.class)) {
  4352. traverse(data.class);
  4353. }
  4354. }
  4355. /* */
  4356. function initRender (vm) {
  4357. vm._vnode = null; // the root of the child tree
  4358. vm._staticTrees = null; // v-once cached trees
  4359. var options = vm.$options;
  4360. var parentVnode = vm.$vnode = options._parentVnode; // the placeholder node in parent tree
  4361. var renderContext = parentVnode && parentVnode.context;
  4362. vm.$slots = resolveSlots(options._renderChildren, renderContext);
  4363. vm.$scopedSlots = emptyObject;
  4364. // bind the createElement fn to this instance
  4365. // so that we get proper render context inside it.
  4366. // args order: tag, data, children, normalizationType, alwaysNormalize
  4367. // internal version is used by render functions compiled from templates
  4368. vm._c = function (a, b, c, d) { return createElement(vm, a, b, c, d, false); };
  4369. // normalization is always applied for the public version, used in
  4370. // user-written render functions.
  4371. vm.$createElement = function (a, b, c, d) { return createElement(vm, a, b, c, d, true); };
  4372. // $attrs & $listeners are exposed for easier HOC creation.
  4373. // they need to be reactive so that HOCs using them are always updated
  4374. var parentData = parentVnode && parentVnode.data;
  4375. /* istanbul ignore else */
  4376. if (true) {
  4377. defineReactive$$1(vm, '$attrs', parentData && parentData.attrs || emptyObject, function () {
  4378. !isUpdatingChildComponent && warn("$attrs is readonly.", vm);
  4379. }, true);
  4380. defineReactive$$1(vm, '$listeners', options._parentListeners || emptyObject, function () {
  4381. !isUpdatingChildComponent && warn("$listeners is readonly.", vm);
  4382. }, true);
  4383. } else {}
  4384. }
  4385. var currentRenderingInstance = null;
  4386. function renderMixin (Vue) {
  4387. // install runtime convenience helpers
  4388. installRenderHelpers(Vue.prototype);
  4389. Vue.prototype.$nextTick = function (fn) {
  4390. return nextTick(fn, this)
  4391. };
  4392. Vue.prototype._render = function () {
  4393. var vm = this;
  4394. var ref = vm.$options;
  4395. var render = ref.render;
  4396. var _parentVnode = ref._parentVnode;
  4397. if (_parentVnode) {
  4398. vm.$scopedSlots = normalizeScopedSlots(
  4399. _parentVnode.data.scopedSlots,
  4400. vm.$slots,
  4401. vm.$scopedSlots
  4402. );
  4403. }
  4404. // set parent vnode. this allows render functions to have access
  4405. // to the data on the placeholder node.
  4406. vm.$vnode = _parentVnode;
  4407. // render self
  4408. var vnode;
  4409. try {
  4410. // There's no need to maintain a stack becaues all render fns are called
  4411. // separately from one another. Nested component's render fns are called
  4412. // when parent component is patched.
  4413. currentRenderingInstance = vm;
  4414. vnode = render.call(vm._renderProxy, vm.$createElement);
  4415. } catch (e) {
  4416. handleError(e, vm, "render");
  4417. // return error render result,
  4418. // or previous vnode to prevent render error causing blank component
  4419. /* istanbul ignore else */
  4420. if ( true && vm.$options.renderError) {
  4421. try {
  4422. vnode = vm.$options.renderError.call(vm._renderProxy, vm.$createElement, e);
  4423. } catch (e) {
  4424. handleError(e, vm, "renderError");
  4425. vnode = vm._vnode;
  4426. }
  4427. } else {
  4428. vnode = vm._vnode;
  4429. }
  4430. } finally {
  4431. currentRenderingInstance = null;
  4432. }
  4433. // if the returned array contains only a single node, allow it
  4434. if (Array.isArray(vnode) && vnode.length === 1) {
  4435. vnode = vnode[0];
  4436. }
  4437. // return empty vnode in case the render function errored out
  4438. if (!(vnode instanceof VNode)) {
  4439. if ( true && Array.isArray(vnode)) {
  4440. warn(
  4441. 'Multiple root nodes returned from render function. Render function ' +
  4442. 'should return a single root node.',
  4443. vm
  4444. );
  4445. }
  4446. vnode = createEmptyVNode();
  4447. }
  4448. // set parent
  4449. vnode.parent = _parentVnode;
  4450. return vnode
  4451. };
  4452. }
  4453. /* */
  4454. function ensureCtor (comp, base) {
  4455. if (
  4456. comp.__esModule ||
  4457. (hasSymbol && comp[Symbol.toStringTag] === 'Module')
  4458. ) {
  4459. comp = comp.default;
  4460. }
  4461. return isObject(comp)
  4462. ? base.extend(comp)
  4463. : comp
  4464. }
  4465. function createAsyncPlaceholder (
  4466. factory,
  4467. data,
  4468. context,
  4469. children,
  4470. tag
  4471. ) {
  4472. var node = createEmptyVNode();
  4473. node.asyncFactory = factory;
  4474. node.asyncMeta = { data: data, context: context, children: children, tag: tag };
  4475. return node
  4476. }
  4477. function resolveAsyncComponent (
  4478. factory,
  4479. baseCtor
  4480. ) {
  4481. if (isTrue(factory.error) && isDef(factory.errorComp)) {
  4482. return factory.errorComp
  4483. }
  4484. if (isDef(factory.resolved)) {
  4485. return factory.resolved
  4486. }
  4487. var owner = currentRenderingInstance;
  4488. if (owner && isDef(factory.owners) && factory.owners.indexOf(owner) === -1) {
  4489. // already pending
  4490. factory.owners.push(owner);
  4491. }
  4492. if (isTrue(factory.loading) && isDef(factory.loadingComp)) {
  4493. return factory.loadingComp
  4494. }
  4495. if (owner && !isDef(factory.owners)) {
  4496. var owners = factory.owners = [owner];
  4497. var sync = true;
  4498. var timerLoading = null;
  4499. var timerTimeout = null
  4500. ;(owner).$on('hook:destroyed', function () { return remove(owners, owner); });
  4501. var forceRender = function (renderCompleted) {
  4502. for (var i = 0, l = owners.length; i < l; i++) {
  4503. (owners[i]).$forceUpdate();
  4504. }
  4505. if (renderCompleted) {
  4506. owners.length = 0;
  4507. if (timerLoading !== null) {
  4508. clearTimeout(timerLoading);
  4509. timerLoading = null;
  4510. }
  4511. if (timerTimeout !== null) {
  4512. clearTimeout(timerTimeout);
  4513. timerTimeout = null;
  4514. }
  4515. }
  4516. };
  4517. var resolve = once(function (res) {
  4518. // cache resolved
  4519. factory.resolved = ensureCtor(res, baseCtor);
  4520. // invoke callbacks only if this is not a synchronous resolve
  4521. // (async resolves are shimmed as synchronous during SSR)
  4522. if (!sync) {
  4523. forceRender(true);
  4524. } else {
  4525. owners.length = 0;
  4526. }
  4527. });
  4528. var reject = once(function (reason) {
  4529. true && warn(
  4530. "Failed to resolve async component: " + (String(factory)) +
  4531. (reason ? ("\nReason: " + reason) : '')
  4532. );
  4533. if (isDef(factory.errorComp)) {
  4534. factory.error = true;
  4535. forceRender(true);
  4536. }
  4537. });
  4538. var res = factory(resolve, reject);
  4539. if (isObject(res)) {
  4540. if (isPromise(res)) {
  4541. // () => Promise
  4542. if (isUndef(factory.resolved)) {
  4543. res.then(resolve, reject);
  4544. }
  4545. } else if (isPromise(res.component)) {
  4546. res.component.then(resolve, reject);
  4547. if (isDef(res.error)) {
  4548. factory.errorComp = ensureCtor(res.error, baseCtor);
  4549. }
  4550. if (isDef(res.loading)) {
  4551. factory.loadingComp = ensureCtor(res.loading, baseCtor);
  4552. if (res.delay === 0) {
  4553. factory.loading = true;
  4554. } else {
  4555. timerLoading = setTimeout(function () {
  4556. timerLoading = null;
  4557. if (isUndef(factory.resolved) && isUndef(factory.error)) {
  4558. factory.loading = true;
  4559. forceRender(false);
  4560. }
  4561. }, res.delay || 200);
  4562. }
  4563. }
  4564. if (isDef(res.timeout)) {
  4565. timerTimeout = setTimeout(function () {
  4566. timerTimeout = null;
  4567. if (isUndef(factory.resolved)) {
  4568. reject(
  4569. true
  4570. ? ("timeout (" + (res.timeout) + "ms)")
  4571. : undefined
  4572. );
  4573. }
  4574. }, res.timeout);
  4575. }
  4576. }
  4577. }
  4578. sync = false;
  4579. // return in case resolved synchronously
  4580. return factory.loading
  4581. ? factory.loadingComp
  4582. : factory.resolved
  4583. }
  4584. }
  4585. /* */
  4586. function isAsyncPlaceholder (node) {
  4587. return node.isComment && node.asyncFactory
  4588. }
  4589. /* */
  4590. function getFirstComponentChild (children) {
  4591. if (Array.isArray(children)) {
  4592. for (var i = 0; i < children.length; i++) {
  4593. var c = children[i];
  4594. if (isDef(c) && (isDef(c.componentOptions) || isAsyncPlaceholder(c))) {
  4595. return c
  4596. }
  4597. }
  4598. }
  4599. }
  4600. /* */
  4601. /* */
  4602. function initEvents (vm) {
  4603. vm._events = Object.create(null);
  4604. vm._hasHookEvent = false;
  4605. // init parent attached events
  4606. var listeners = vm.$options._parentListeners;
  4607. if (listeners) {
  4608. updateComponentListeners(vm, listeners);
  4609. }
  4610. }
  4611. var target;
  4612. function add (event, fn) {
  4613. target.$on(event, fn);
  4614. }
  4615. function remove$1 (event, fn) {
  4616. target.$off(event, fn);
  4617. }
  4618. function createOnceHandler (event, fn) {
  4619. var _target = target;
  4620. return function onceHandler () {
  4621. var res = fn.apply(null, arguments);
  4622. if (res !== null) {
  4623. _target.$off(event, onceHandler);
  4624. }
  4625. }
  4626. }
  4627. function updateComponentListeners (
  4628. vm,
  4629. listeners,
  4630. oldListeners
  4631. ) {
  4632. target = vm;
  4633. updateListeners(listeners, oldListeners || {}, add, remove$1, createOnceHandler, vm);
  4634. target = undefined;
  4635. }
  4636. function eventsMixin (Vue) {
  4637. var hookRE = /^hook:/;
  4638. Vue.prototype.$on = function (event, fn) {
  4639. var vm = this;
  4640. if (Array.isArray(event)) {
  4641. for (var i = 0, l = event.length; i < l; i++) {
  4642. vm.$on(event[i], fn);
  4643. }
  4644. } else {
  4645. (vm._events[event] || (vm._events[event] = [])).push(fn);
  4646. // optimize hook:event cost by using a boolean flag marked at registration
  4647. // instead of a hash lookup
  4648. if (hookRE.test(event)) {
  4649. vm._hasHookEvent = true;
  4650. }
  4651. }
  4652. return vm
  4653. };
  4654. Vue.prototype.$once = function (event, fn) {
  4655. var vm = this;
  4656. function on () {
  4657. vm.$off(event, on);
  4658. fn.apply(vm, arguments);
  4659. }
  4660. on.fn = fn;
  4661. vm.$on(event, on);
  4662. return vm
  4663. };
  4664. Vue.prototype.$off = function (event, fn) {
  4665. var vm = this;
  4666. // all
  4667. if (!arguments.length) {
  4668. vm._events = Object.create(null);
  4669. return vm
  4670. }
  4671. // array of events
  4672. if (Array.isArray(event)) {
  4673. for (var i$1 = 0, l = event.length; i$1 < l; i$1++) {
  4674. vm.$off(event[i$1], fn);
  4675. }
  4676. return vm
  4677. }
  4678. // specific event
  4679. var cbs = vm._events[event];
  4680. if (!cbs) {
  4681. return vm
  4682. }
  4683. if (!fn) {
  4684. vm._events[event] = null;
  4685. return vm
  4686. }
  4687. // specific handler
  4688. var cb;
  4689. var i = cbs.length;
  4690. while (i--) {
  4691. cb = cbs[i];
  4692. if (cb === fn || cb.fn === fn) {
  4693. cbs.splice(i, 1);
  4694. break
  4695. }
  4696. }
  4697. return vm
  4698. };
  4699. Vue.prototype.$emit = function (event) {
  4700. var vm = this;
  4701. if (true) {
  4702. var lowerCaseEvent = event.toLowerCase();
  4703. if (lowerCaseEvent !== event && vm._events[lowerCaseEvent]) {
  4704. tip(
  4705. "Event \"" + lowerCaseEvent + "\" is emitted in component " +
  4706. (formatComponentName(vm)) + " but the handler is registered for \"" + event + "\". " +
  4707. "Note that HTML attributes are case-insensitive and you cannot use " +
  4708. "v-on to listen to camelCase events when using in-DOM templates. " +
  4709. "You should probably use \"" + (hyphenate(event)) + "\" instead of \"" + event + "\"."
  4710. );
  4711. }
  4712. }
  4713. var cbs = vm._events[event];
  4714. if (cbs) {
  4715. cbs = cbs.length > 1 ? toArray(cbs) : cbs;
  4716. var args = toArray(arguments, 1);
  4717. var info = "event handler for \"" + event + "\"";
  4718. for (var i = 0, l = cbs.length; i < l; i++) {
  4719. invokeWithErrorHandling(cbs[i], vm, args, vm, info);
  4720. }
  4721. }
  4722. return vm
  4723. };
  4724. }
  4725. /* */
  4726. var activeInstance = null;
  4727. var isUpdatingChildComponent = false;
  4728. function setActiveInstance(vm) {
  4729. var prevActiveInstance = activeInstance;
  4730. activeInstance = vm;
  4731. return function () {
  4732. activeInstance = prevActiveInstance;
  4733. }
  4734. }
  4735. function initLifecycle (vm) {
  4736. var options = vm.$options;
  4737. // locate first non-abstract parent
  4738. var parent = options.parent;
  4739. if (parent && !options.abstract) {
  4740. while (parent.$options.abstract && parent.$parent) {
  4741. parent = parent.$parent;
  4742. }
  4743. parent.$children.push(vm);
  4744. }
  4745. vm.$parent = parent;
  4746. vm.$root = parent ? parent.$root : vm;
  4747. vm.$children = [];
  4748. vm.$refs = {};
  4749. vm._watcher = null;
  4750. vm._inactive = null;
  4751. vm._directInactive = false;
  4752. vm._isMounted = false;
  4753. vm._isDestroyed = false;
  4754. vm._isBeingDestroyed = false;
  4755. }
  4756. function lifecycleMixin (Vue) {
  4757. Vue.prototype._update = function (vnode, hydrating) {
  4758. var vm = this;
  4759. var prevEl = vm.$el;
  4760. var prevVnode = vm._vnode;
  4761. var restoreActiveInstance = setActiveInstance(vm);
  4762. vm._vnode = vnode;
  4763. // Vue.prototype.__patch__ is injected in entry points
  4764. // based on the rendering backend used.
  4765. if (!prevVnode) {
  4766. // initial render
  4767. vm.$el = vm.__patch__(vm.$el, vnode, hydrating, false /* removeOnly */);
  4768. } else {
  4769. // updates
  4770. vm.$el = vm.__patch__(prevVnode, vnode);
  4771. }
  4772. restoreActiveInstance();
  4773. // update __vue__ reference
  4774. if (prevEl) {
  4775. prevEl.__vue__ = null;
  4776. }
  4777. if (vm.$el) {
  4778. vm.$el.__vue__ = vm;
  4779. }
  4780. // if parent is an HOC, update its $el as well
  4781. if (vm.$vnode && vm.$parent && vm.$vnode === vm.$parent._vnode) {
  4782. vm.$parent.$el = vm.$el;
  4783. }
  4784. // updated hook is called by the scheduler to ensure that children are
  4785. // updated in a parent's updated hook.
  4786. };
  4787. Vue.prototype.$forceUpdate = function () {
  4788. var vm = this;
  4789. if (vm._watcher) {
  4790. vm._watcher.update();
  4791. }
  4792. };
  4793. Vue.prototype.$destroy = function () {
  4794. var vm = this;
  4795. if (vm._isBeingDestroyed) {
  4796. return
  4797. }
  4798. callHook(vm, 'beforeDestroy');
  4799. vm._isBeingDestroyed = true;
  4800. // remove self from parent
  4801. var parent = vm.$parent;
  4802. if (parent && !parent._isBeingDestroyed && !vm.$options.abstract) {
  4803. remove(parent.$children, vm);
  4804. }
  4805. // teardown watchers
  4806. if (vm._watcher) {
  4807. vm._watcher.teardown();
  4808. }
  4809. var i = vm._watchers.length;
  4810. while (i--) {
  4811. vm._watchers[i].teardown();
  4812. }
  4813. // remove reference from data ob
  4814. // frozen object may not have observer.
  4815. if (vm._data.__ob__) {
  4816. vm._data.__ob__.vmCount--;
  4817. }
  4818. // call the last hook...
  4819. vm._isDestroyed = true;
  4820. // invoke destroy hooks on current rendered tree
  4821. vm.__patch__(vm._vnode, null);
  4822. // fire destroyed hook
  4823. callHook(vm, 'destroyed');
  4824. // turn off all instance listeners.
  4825. vm.$off();
  4826. // remove __vue__ reference
  4827. if (vm.$el) {
  4828. vm.$el.__vue__ = null;
  4829. }
  4830. // release circular reference (#6759)
  4831. if (vm.$vnode) {
  4832. vm.$vnode.parent = null;
  4833. }
  4834. };
  4835. }
  4836. function updateChildComponent (
  4837. vm,
  4838. propsData,
  4839. listeners,
  4840. parentVnode,
  4841. renderChildren
  4842. ) {
  4843. if (true) {
  4844. isUpdatingChildComponent = true;
  4845. }
  4846. // determine whether component has slot children
  4847. // we need to do this before overwriting $options._renderChildren.
  4848. // check if there are dynamic scopedSlots (hand-written or compiled but with
  4849. // dynamic slot names). Static scoped slots compiled from template has the
  4850. // "$stable" marker.
  4851. var newScopedSlots = parentVnode.data.scopedSlots;
  4852. var oldScopedSlots = vm.$scopedSlots;
  4853. var hasDynamicScopedSlot = !!(
  4854. (newScopedSlots && !newScopedSlots.$stable) ||
  4855. (oldScopedSlots !== emptyObject && !oldScopedSlots.$stable) ||
  4856. (newScopedSlots && vm.$scopedSlots.$key !== newScopedSlots.$key)
  4857. );
  4858. // Any static slot children from the parent may have changed during parent's
  4859. // update. Dynamic scoped slots may also have changed. In such cases, a forced
  4860. // update is necessary to ensure correctness.
  4861. var needsForceUpdate = !!(
  4862. renderChildren || // has new static slots
  4863. vm.$options._renderChildren || // has old static slots
  4864. hasDynamicScopedSlot
  4865. );
  4866. vm.$options._parentVnode = parentVnode;
  4867. vm.$vnode = parentVnode; // update vm's placeholder node without re-render
  4868. if (vm._vnode) { // update child tree's parent
  4869. vm._vnode.parent = parentVnode;
  4870. }
  4871. vm.$options._renderChildren = renderChildren;
  4872. // update $attrs and $listeners hash
  4873. // these are also reactive so they may trigger child update if the child
  4874. // used them during render
  4875. vm.$attrs = parentVnode.data.attrs || emptyObject;
  4876. vm.$listeners = listeners || emptyObject;
  4877. // update props
  4878. if (propsData && vm.$options.props) {
  4879. toggleObserving(false);
  4880. var props = vm._props;
  4881. var propKeys = vm.$options._propKeys || [];
  4882. for (var i = 0; i < propKeys.length; i++) {
  4883. var key = propKeys[i];
  4884. var propOptions = vm.$options.props; // wtf flow?
  4885. props[key] = validateProp(key, propOptions, propsData, vm);
  4886. }
  4887. toggleObserving(true);
  4888. // keep a copy of raw propsData
  4889. vm.$options.propsData = propsData;
  4890. }
  4891. // update listeners
  4892. listeners = listeners || emptyObject;
  4893. var oldListeners = vm.$options._parentListeners;
  4894. vm.$options._parentListeners = listeners;
  4895. updateComponentListeners(vm, listeners, oldListeners);
  4896. // resolve slots + force update if has children
  4897. if (needsForceUpdate) {
  4898. vm.$slots = resolveSlots(renderChildren, parentVnode.context);
  4899. vm.$forceUpdate();
  4900. }
  4901. if (true) {
  4902. isUpdatingChildComponent = false;
  4903. }
  4904. }
  4905. function isInInactiveTree (vm) {
  4906. while (vm && (vm = vm.$parent)) {
  4907. if (vm._inactive) { return true }
  4908. }
  4909. return false
  4910. }
  4911. function activateChildComponent (vm, direct) {
  4912. if (direct) {
  4913. vm._directInactive = false;
  4914. if (isInInactiveTree(vm)) {
  4915. return
  4916. }
  4917. } else if (vm._directInactive) {
  4918. return
  4919. }
  4920. if (vm._inactive || vm._inactive === null) {
  4921. vm._inactive = false;
  4922. for (var i = 0; i < vm.$children.length; i++) {
  4923. activateChildComponent(vm.$children[i]);
  4924. }
  4925. callHook(vm, 'activated');
  4926. }
  4927. }
  4928. function deactivateChildComponent (vm, direct) {
  4929. if (direct) {
  4930. vm._directInactive = true;
  4931. if (isInInactiveTree(vm)) {
  4932. return
  4933. }
  4934. }
  4935. if (!vm._inactive) {
  4936. vm._inactive = true;
  4937. for (var i = 0; i < vm.$children.length; i++) {
  4938. deactivateChildComponent(vm.$children[i]);
  4939. }
  4940. callHook(vm, 'deactivated');
  4941. }
  4942. }
  4943. function callHook (vm, hook) {
  4944. // #7573 disable dep collection when invoking lifecycle hooks
  4945. pushTarget();
  4946. var handlers = vm.$options[hook];
  4947. var info = hook + " hook";
  4948. if (handlers) {
  4949. for (var i = 0, j = handlers.length; i < j; i++) {
  4950. invokeWithErrorHandling(handlers[i], vm, null, vm, info);
  4951. }
  4952. }
  4953. if (vm._hasHookEvent) {
  4954. vm.$emit('hook:' + hook);
  4955. }
  4956. popTarget();
  4957. }
  4958. /* */
  4959. var MAX_UPDATE_COUNT = 100;
  4960. var queue = [];
  4961. var activatedChildren = [];
  4962. var has = {};
  4963. var circular = {};
  4964. var waiting = false;
  4965. var flushing = false;
  4966. var index = 0;
  4967. /**
  4968. * Reset the scheduler's state.
  4969. */
  4970. function resetSchedulerState () {
  4971. index = queue.length = activatedChildren.length = 0;
  4972. has = {};
  4973. if (true) {
  4974. circular = {};
  4975. }
  4976. waiting = flushing = false;
  4977. }
  4978. // Async edge case #6566 requires saving the timestamp when event listeners are
  4979. // attached. However, calling performance.now() has a perf overhead especially
  4980. // if the page has thousands of event listeners. Instead, we take a timestamp
  4981. // every time the scheduler flushes and use that for all event listeners
  4982. // attached during that flush.
  4983. var currentFlushTimestamp = 0;
  4984. // Async edge case fix requires storing an event listener's attach timestamp.
  4985. var getNow = Date.now;
  4986. // Determine what event timestamp the browser is using. Annoyingly, the
  4987. // timestamp can either be hi-res (relative to page load) or low-res
  4988. // (relative to UNIX epoch), so in order to compare time we have to use the
  4989. // same timestamp type when saving the flush timestamp.
  4990. // All IE versions use low-res event timestamps, and have problematic clock
  4991. // implementations (#9632)
  4992. if (inBrowser && !isIE) {
  4993. var performance = window.performance;
  4994. if (
  4995. performance &&
  4996. typeof performance.now === 'function' &&
  4997. getNow() > document.createEvent('Event').timeStamp
  4998. ) {
  4999. // if the event timestamp, although evaluated AFTER the Date.now(), is
  5000. // smaller than it, it means the event is using a hi-res timestamp,
  5001. // and we need to use the hi-res version for event listener timestamps as
  5002. // well.
  5003. getNow = function () { return performance.now(); };
  5004. }
  5005. }
  5006. /**
  5007. * Flush both queues and run the watchers.
  5008. */
  5009. function flushSchedulerQueue () {
  5010. currentFlushTimestamp = getNow();
  5011. flushing = true;
  5012. var watcher, id;
  5013. // Sort queue before flush.
  5014. // This ensures that:
  5015. // 1. Components are updated from parent to child. (because parent is always
  5016. // created before the child)
  5017. // 2. A component's user watchers are run before its render watcher (because
  5018. // user watchers are created before the render watcher)
  5019. // 3. If a component is destroyed during a parent component's watcher run,
  5020. // its watchers can be skipped.
  5021. queue.sort(function (a, b) { return a.id - b.id; });
  5022. // do not cache length because more watchers might be pushed
  5023. // as we run existing watchers
  5024. for (index = 0; index < queue.length; index++) {
  5025. watcher = queue[index];
  5026. if (watcher.before) {
  5027. watcher.before();
  5028. }
  5029. id = watcher.id;
  5030. has[id] = null;
  5031. watcher.run();
  5032. // in dev build, check and stop circular updates.
  5033. if ( true && has[id] != null) {
  5034. circular[id] = (circular[id] || 0) + 1;
  5035. if (circular[id] > MAX_UPDATE_COUNT) {
  5036. warn(
  5037. 'You may have an infinite update loop ' + (
  5038. watcher.user
  5039. ? ("in watcher with expression \"" + (watcher.expression) + "\"")
  5040. : "in a component render function."
  5041. ),
  5042. watcher.vm
  5043. );
  5044. break
  5045. }
  5046. }
  5047. }
  5048. // keep copies of post queues before resetting state
  5049. var activatedQueue = activatedChildren.slice();
  5050. var updatedQueue = queue.slice();
  5051. resetSchedulerState();
  5052. // call component updated and activated hooks
  5053. callActivatedHooks(activatedQueue);
  5054. callUpdatedHooks(updatedQueue);
  5055. // devtool hook
  5056. /* istanbul ignore if */
  5057. if (devtools && config.devtools) {
  5058. devtools.emit('flush');
  5059. }
  5060. }
  5061. function callUpdatedHooks (queue) {
  5062. var i = queue.length;
  5063. while (i--) {
  5064. var watcher = queue[i];
  5065. var vm = watcher.vm;
  5066. if (vm._watcher === watcher && vm._isMounted && !vm._isDestroyed) {
  5067. callHook(vm, 'updated');
  5068. }
  5069. }
  5070. }
  5071. /**
  5072. * Queue a kept-alive component that was activated during patch.
  5073. * The queue will be processed after the entire tree has been patched.
  5074. */
  5075. function queueActivatedComponent (vm) {
  5076. // setting _inactive to false here so that a render function can
  5077. // rely on checking whether it's in an inactive tree (e.g. router-view)
  5078. vm._inactive = false;
  5079. activatedChildren.push(vm);
  5080. }
  5081. function callActivatedHooks (queue) {
  5082. for (var i = 0; i < queue.length; i++) {
  5083. queue[i]._inactive = true;
  5084. activateChildComponent(queue[i], true /* true */);
  5085. }
  5086. }
  5087. /**
  5088. * Push a watcher into the watcher queue.
  5089. * Jobs with duplicate IDs will be skipped unless it's
  5090. * pushed when the queue is being flushed.
  5091. */
  5092. function queueWatcher (watcher) {
  5093. var id = watcher.id;
  5094. if (has[id] == null) {
  5095. has[id] = true;
  5096. if (!flushing) {
  5097. queue.push(watcher);
  5098. } else {
  5099. // if already flushing, splice the watcher based on its id
  5100. // if already past its id, it will be run next immediately.
  5101. var i = queue.length - 1;
  5102. while (i > index && queue[i].id > watcher.id) {
  5103. i--;
  5104. }
  5105. queue.splice(i + 1, 0, watcher);
  5106. }
  5107. // queue the flush
  5108. if (!waiting) {
  5109. waiting = true;
  5110. if ( true && !config.async) {
  5111. flushSchedulerQueue();
  5112. return
  5113. }
  5114. nextTick(flushSchedulerQueue);
  5115. }
  5116. }
  5117. }
  5118. /* */
  5119. var uid$2 = 0;
  5120. /**
  5121. * A watcher parses an expression, collects dependencies,
  5122. * and fires callback when the expression value changes.
  5123. * This is used for both the $watch() api and directives.
  5124. */
  5125. var Watcher = function Watcher (
  5126. vm,
  5127. expOrFn,
  5128. cb,
  5129. options,
  5130. isRenderWatcher
  5131. ) {
  5132. this.vm = vm;
  5133. if (isRenderWatcher) {
  5134. vm._watcher = this;
  5135. }
  5136. vm._watchers.push(this);
  5137. // options
  5138. if (options) {
  5139. this.deep = !!options.deep;
  5140. this.user = !!options.user;
  5141. this.lazy = !!options.lazy;
  5142. this.sync = !!options.sync;
  5143. this.before = options.before;
  5144. } else {
  5145. this.deep = this.user = this.lazy = this.sync = false;
  5146. }
  5147. this.cb = cb;
  5148. this.id = ++uid$2; // uid for batching
  5149. this.active = true;
  5150. this.dirty = this.lazy; // for lazy watchers
  5151. this.deps = [];
  5152. this.newDeps = [];
  5153. this.depIds = new _Set();
  5154. this.newDepIds = new _Set();
  5155. this.expression = true
  5156. ? expOrFn.toString()
  5157. : undefined;
  5158. // parse expression for getter
  5159. if (typeof expOrFn === 'function') {
  5160. this.getter = expOrFn;
  5161. } else {
  5162. this.getter = parsePath(expOrFn);
  5163. if (!this.getter) {
  5164. this.getter = noop;
  5165. true && warn(
  5166. "Failed watching path: \"" + expOrFn + "\" " +
  5167. 'Watcher only accepts simple dot-delimited paths. ' +
  5168. 'For full control, use a function instead.',
  5169. vm
  5170. );
  5171. }
  5172. }
  5173. this.value = this.lazy
  5174. ? undefined
  5175. : this.get();
  5176. };
  5177. /**
  5178. * Evaluate the getter, and re-collect dependencies.
  5179. */
  5180. Watcher.prototype.get = function get () {
  5181. pushTarget(this);
  5182. var value;
  5183. var vm = this.vm;
  5184. try {
  5185. value = this.getter.call(vm, vm);
  5186. } catch (e) {
  5187. if (this.user) {
  5188. handleError(e, vm, ("getter for watcher \"" + (this.expression) + "\""));
  5189. } else {
  5190. throw e
  5191. }
  5192. } finally {
  5193. // "touch" every property so they are all tracked as
  5194. // dependencies for deep watching
  5195. if (this.deep) {
  5196. traverse(value);
  5197. }
  5198. popTarget();
  5199. this.cleanupDeps();
  5200. }
  5201. return value
  5202. };
  5203. /**
  5204. * Add a dependency to this directive.
  5205. */
  5206. Watcher.prototype.addDep = function addDep (dep) {
  5207. var id = dep.id;
  5208. if (!this.newDepIds.has(id)) {
  5209. this.newDepIds.add(id);
  5210. this.newDeps.push(dep);
  5211. if (!this.depIds.has(id)) {
  5212. dep.addSub(this);
  5213. }
  5214. }
  5215. };
  5216. /**
  5217. * Clean up for dependency collection.
  5218. */
  5219. Watcher.prototype.cleanupDeps = function cleanupDeps () {
  5220. var i = this.deps.length;
  5221. while (i--) {
  5222. var dep = this.deps[i];
  5223. if (!this.newDepIds.has(dep.id)) {
  5224. dep.removeSub(this);
  5225. }
  5226. }
  5227. var tmp = this.depIds;
  5228. this.depIds = this.newDepIds;
  5229. this.newDepIds = tmp;
  5230. this.newDepIds.clear();
  5231. tmp = this.deps;
  5232. this.deps = this.newDeps;
  5233. this.newDeps = tmp;
  5234. this.newDeps.length = 0;
  5235. };
  5236. /**
  5237. * Subscriber interface.
  5238. * Will be called when a dependency changes.
  5239. */
  5240. Watcher.prototype.update = function update () {
  5241. /* istanbul ignore else */
  5242. if (this.lazy) {
  5243. this.dirty = true;
  5244. } else if (this.sync) {
  5245. this.run();
  5246. } else {
  5247. queueWatcher(this);
  5248. }
  5249. };
  5250. /**
  5251. * Scheduler job interface.
  5252. * Will be called by the scheduler.
  5253. */
  5254. Watcher.prototype.run = function run () {
  5255. if (this.active) {
  5256. var value = this.get();
  5257. if (
  5258. value !== this.value ||
  5259. // Deep watchers and watchers on Object/Arrays should fire even
  5260. // when the value is the same, because the value may
  5261. // have mutated.
  5262. isObject(value) ||
  5263. this.deep
  5264. ) {
  5265. // set new value
  5266. var oldValue = this.value;
  5267. this.value = value;
  5268. if (this.user) {
  5269. try {
  5270. this.cb.call(this.vm, value, oldValue);
  5271. } catch (e) {
  5272. handleError(e, this.vm, ("callback for watcher \"" + (this.expression) + "\""));
  5273. }
  5274. } else {
  5275. this.cb.call(this.vm, value, oldValue);
  5276. }
  5277. }
  5278. }
  5279. };
  5280. /**
  5281. * Evaluate the value of the watcher.
  5282. * This only gets called for lazy watchers.
  5283. */
  5284. Watcher.prototype.evaluate = function evaluate () {
  5285. this.value = this.get();
  5286. this.dirty = false;
  5287. };
  5288. /**
  5289. * Depend on all deps collected by this watcher.
  5290. */
  5291. Watcher.prototype.depend = function depend () {
  5292. var i = this.deps.length;
  5293. while (i--) {
  5294. this.deps[i].depend();
  5295. }
  5296. };
  5297. /**
  5298. * Remove self from all dependencies' subscriber list.
  5299. */
  5300. Watcher.prototype.teardown = function teardown () {
  5301. if (this.active) {
  5302. // remove self from vm's watcher list
  5303. // this is a somewhat expensive operation so we skip it
  5304. // if the vm is being destroyed.
  5305. if (!this.vm._isBeingDestroyed) {
  5306. remove(this.vm._watchers, this);
  5307. }
  5308. var i = this.deps.length;
  5309. while (i--) {
  5310. this.deps[i].removeSub(this);
  5311. }
  5312. this.active = false;
  5313. }
  5314. };
  5315. /* */
  5316. var sharedPropertyDefinition = {
  5317. enumerable: true,
  5318. configurable: true,
  5319. get: noop,
  5320. set: noop
  5321. };
  5322. function proxy (target, sourceKey, key) {
  5323. sharedPropertyDefinition.get = function proxyGetter () {
  5324. return this[sourceKey][key]
  5325. };
  5326. sharedPropertyDefinition.set = function proxySetter (val) {
  5327. this[sourceKey][key] = val;
  5328. };
  5329. Object.defineProperty(target, key, sharedPropertyDefinition);
  5330. }
  5331. function initState (vm) {
  5332. vm._watchers = [];
  5333. var opts = vm.$options;
  5334. if (opts.props) { initProps(vm, opts.props); }
  5335. if (opts.methods) { initMethods(vm, opts.methods); }
  5336. if (opts.data) {
  5337. initData(vm);
  5338. } else {
  5339. observe(vm._data = {}, true /* asRootData */);
  5340. }
  5341. if (opts.computed) { initComputed(vm, opts.computed); }
  5342. if (opts.watch && opts.watch !== nativeWatch) {
  5343. initWatch(vm, opts.watch);
  5344. }
  5345. }
  5346. function initProps (vm, propsOptions) {
  5347. var propsData = vm.$options.propsData || {};
  5348. var props = vm._props = {};
  5349. // cache prop keys so that future props updates can iterate using Array
  5350. // instead of dynamic object key enumeration.
  5351. var keys = vm.$options._propKeys = [];
  5352. var isRoot = !vm.$parent;
  5353. // root instance props should be converted
  5354. if (!isRoot) {
  5355. toggleObserving(false);
  5356. }
  5357. var loop = function ( key ) {
  5358. keys.push(key);
  5359. var value = validateProp(key, propsOptions, propsData, vm);
  5360. /* istanbul ignore else */
  5361. if (true) {
  5362. var hyphenatedKey = hyphenate(key);
  5363. if (isReservedAttribute(hyphenatedKey) ||
  5364. config.isReservedAttr(hyphenatedKey)) {
  5365. warn(
  5366. ("\"" + hyphenatedKey + "\" is a reserved attribute and cannot be used as component prop."),
  5367. vm
  5368. );
  5369. }
  5370. defineReactive$$1(props, key, value, function () {
  5371. if (!isRoot && !isUpdatingChildComponent) {
  5372. {
  5373. if(vm.mpHost === 'mp-baidu'){//百度 observer 在 setData callback 之后触发,直接忽略该 warn
  5374. return
  5375. }
  5376. //fixed by xxxxxx __next_tick_pending,uni://form-field 时不告警
  5377. if(
  5378. key === 'value' &&
  5379. Array.isArray(vm.$options.behaviors) &&
  5380. vm.$options.behaviors.indexOf('uni://form-field') !== -1
  5381. ){
  5382. return
  5383. }
  5384. if(vm._getFormData){
  5385. return
  5386. }
  5387. var $parent = vm.$parent;
  5388. while($parent){
  5389. if($parent.__next_tick_pending){
  5390. return
  5391. }
  5392. $parent = $parent.$parent;
  5393. }
  5394. }
  5395. warn(
  5396. "Avoid mutating a prop directly since the value will be " +
  5397. "overwritten whenever the parent component re-renders. " +
  5398. "Instead, use a data or computed property based on the prop's " +
  5399. "value. Prop being mutated: \"" + key + "\"",
  5400. vm
  5401. );
  5402. }
  5403. });
  5404. } else {}
  5405. // static props are already proxied on the component's prototype
  5406. // during Vue.extend(). We only need to proxy props defined at
  5407. // instantiation here.
  5408. if (!(key in vm)) {
  5409. proxy(vm, "_props", key);
  5410. }
  5411. };
  5412. for (var key in propsOptions) loop( key );
  5413. toggleObserving(true);
  5414. }
  5415. function initData (vm) {
  5416. var data = vm.$options.data;
  5417. data = vm._data = typeof data === 'function'
  5418. ? getData(data, vm)
  5419. : data || {};
  5420. if (!isPlainObject(data)) {
  5421. data = {};
  5422. true && warn(
  5423. 'data functions should return an object:\n' +
  5424. 'https://vuejs.org/v2/guide/components.html#data-Must-Be-a-Function',
  5425. vm
  5426. );
  5427. }
  5428. // proxy data on instance
  5429. var keys = Object.keys(data);
  5430. var props = vm.$options.props;
  5431. var methods = vm.$options.methods;
  5432. var i = keys.length;
  5433. while (i--) {
  5434. var key = keys[i];
  5435. if (true) {
  5436. if (methods && hasOwn(methods, key)) {
  5437. warn(
  5438. ("Method \"" + key + "\" has already been defined as a data property."),
  5439. vm
  5440. );
  5441. }
  5442. }
  5443. if (props && hasOwn(props, key)) {
  5444. true && warn(
  5445. "The data property \"" + key + "\" is already declared as a prop. " +
  5446. "Use prop default value instead.",
  5447. vm
  5448. );
  5449. } else if (!isReserved(key)) {
  5450. proxy(vm, "_data", key);
  5451. }
  5452. }
  5453. // observe data
  5454. observe(data, true /* asRootData */);
  5455. }
  5456. function getData (data, vm) {
  5457. // #7573 disable dep collection when invoking data getters
  5458. pushTarget();
  5459. try {
  5460. return data.call(vm, vm)
  5461. } catch (e) {
  5462. handleError(e, vm, "data()");
  5463. return {}
  5464. } finally {
  5465. popTarget();
  5466. }
  5467. }
  5468. var computedWatcherOptions = { lazy: true };
  5469. function initComputed (vm, computed) {
  5470. // $flow-disable-line
  5471. var watchers = vm._computedWatchers = Object.create(null);
  5472. // computed properties are just getters during SSR
  5473. var isSSR = isServerRendering();
  5474. for (var key in computed) {
  5475. var userDef = computed[key];
  5476. var getter = typeof userDef === 'function' ? userDef : userDef.get;
  5477. if ( true && getter == null) {
  5478. warn(
  5479. ("Getter is missing for computed property \"" + key + "\"."),
  5480. vm
  5481. );
  5482. }
  5483. if (!isSSR) {
  5484. // create internal watcher for the computed property.
  5485. watchers[key] = new Watcher(
  5486. vm,
  5487. getter || noop,
  5488. noop,
  5489. computedWatcherOptions
  5490. );
  5491. }
  5492. // component-defined computed properties are already defined on the
  5493. // component prototype. We only need to define computed properties defined
  5494. // at instantiation here.
  5495. if (!(key in vm)) {
  5496. defineComputed(vm, key, userDef);
  5497. } else if (true) {
  5498. if (key in vm.$data) {
  5499. warn(("The computed property \"" + key + "\" is already defined in data."), vm);
  5500. } else if (vm.$options.props && key in vm.$options.props) {
  5501. warn(("The computed property \"" + key + "\" is already defined as a prop."), vm);
  5502. }
  5503. }
  5504. }
  5505. }
  5506. function defineComputed (
  5507. target,
  5508. key,
  5509. userDef
  5510. ) {
  5511. var shouldCache = !isServerRendering();
  5512. if (typeof userDef === 'function') {
  5513. sharedPropertyDefinition.get = shouldCache
  5514. ? createComputedGetter(key)
  5515. : createGetterInvoker(userDef);
  5516. sharedPropertyDefinition.set = noop;
  5517. } else {
  5518. sharedPropertyDefinition.get = userDef.get
  5519. ? shouldCache && userDef.cache !== false
  5520. ? createComputedGetter(key)
  5521. : createGetterInvoker(userDef.get)
  5522. : noop;
  5523. sharedPropertyDefinition.set = userDef.set || noop;
  5524. }
  5525. if ( true &&
  5526. sharedPropertyDefinition.set === noop) {
  5527. sharedPropertyDefinition.set = function () {
  5528. warn(
  5529. ("Computed property \"" + key + "\" was assigned to but it has no setter."),
  5530. this
  5531. );
  5532. };
  5533. }
  5534. Object.defineProperty(target, key, sharedPropertyDefinition);
  5535. }
  5536. function createComputedGetter (key) {
  5537. return function computedGetter () {
  5538. var watcher = this._computedWatchers && this._computedWatchers[key];
  5539. if (watcher) {
  5540. if (watcher.dirty) {
  5541. watcher.evaluate();
  5542. }
  5543. if (Dep.target) {
  5544. watcher.depend();
  5545. }
  5546. return watcher.value
  5547. }
  5548. }
  5549. }
  5550. function createGetterInvoker(fn) {
  5551. return function computedGetter () {
  5552. return fn.call(this, this)
  5553. }
  5554. }
  5555. function initMethods (vm, methods) {
  5556. var props = vm.$options.props;
  5557. for (var key in methods) {
  5558. if (true) {
  5559. if (typeof methods[key] !== 'function') {
  5560. warn(
  5561. "Method \"" + key + "\" has type \"" + (typeof methods[key]) + "\" in the component definition. " +
  5562. "Did you reference the function correctly?",
  5563. vm
  5564. );
  5565. }
  5566. if (props && hasOwn(props, key)) {
  5567. warn(
  5568. ("Method \"" + key + "\" has already been defined as a prop."),
  5569. vm
  5570. );
  5571. }
  5572. if ((key in vm) && isReserved(key)) {
  5573. warn(
  5574. "Method \"" + key + "\" conflicts with an existing Vue instance method. " +
  5575. "Avoid defining component methods that start with _ or $."
  5576. );
  5577. }
  5578. }
  5579. vm[key] = typeof methods[key] !== 'function' ? noop : bind(methods[key], vm);
  5580. }
  5581. }
  5582. function initWatch (vm, watch) {
  5583. for (var key in watch) {
  5584. var handler = watch[key];
  5585. if (Array.isArray(handler)) {
  5586. for (var i = 0; i < handler.length; i++) {
  5587. createWatcher(vm, key, handler[i]);
  5588. }
  5589. } else {
  5590. createWatcher(vm, key, handler);
  5591. }
  5592. }
  5593. }
  5594. function createWatcher (
  5595. vm,
  5596. expOrFn,
  5597. handler,
  5598. options
  5599. ) {
  5600. if (isPlainObject(handler)) {
  5601. options = handler;
  5602. handler = handler.handler;
  5603. }
  5604. if (typeof handler === 'string') {
  5605. handler = vm[handler];
  5606. }
  5607. return vm.$watch(expOrFn, handler, options)
  5608. }
  5609. function stateMixin (Vue) {
  5610. // flow somehow has problems with directly declared definition object
  5611. // when using Object.defineProperty, so we have to procedurally build up
  5612. // the object here.
  5613. var dataDef = {};
  5614. dataDef.get = function () { return this._data };
  5615. var propsDef = {};
  5616. propsDef.get = function () { return this._props };
  5617. if (true) {
  5618. dataDef.set = function () {
  5619. warn(
  5620. 'Avoid replacing instance root $data. ' +
  5621. 'Use nested data properties instead.',
  5622. this
  5623. );
  5624. };
  5625. propsDef.set = function () {
  5626. warn("$props is readonly.", this);
  5627. };
  5628. }
  5629. Object.defineProperty(Vue.prototype, '$data', dataDef);
  5630. Object.defineProperty(Vue.prototype, '$props', propsDef);
  5631. Vue.prototype.$set = set;
  5632. Vue.prototype.$delete = del;
  5633. Vue.prototype.$watch = function (
  5634. expOrFn,
  5635. cb,
  5636. options
  5637. ) {
  5638. var vm = this;
  5639. if (isPlainObject(cb)) {
  5640. return createWatcher(vm, expOrFn, cb, options)
  5641. }
  5642. options = options || {};
  5643. options.user = true;
  5644. var watcher = new Watcher(vm, expOrFn, cb, options);
  5645. if (options.immediate) {
  5646. try {
  5647. cb.call(vm, watcher.value);
  5648. } catch (error) {
  5649. handleError(error, vm, ("callback for immediate watcher \"" + (watcher.expression) + "\""));
  5650. }
  5651. }
  5652. return function unwatchFn () {
  5653. watcher.teardown();
  5654. }
  5655. };
  5656. }
  5657. /* */
  5658. var uid$3 = 0;
  5659. function initMixin (Vue) {
  5660. Vue.prototype._init = function (options) {
  5661. var vm = this;
  5662. // a uid
  5663. vm._uid = uid$3++;
  5664. var startTag, endTag;
  5665. /* istanbul ignore if */
  5666. if ( true && config.performance && mark) {
  5667. startTag = "vue-perf-start:" + (vm._uid);
  5668. endTag = "vue-perf-end:" + (vm._uid);
  5669. mark(startTag);
  5670. }
  5671. // a flag to avoid this being observed
  5672. vm._isVue = true;
  5673. // merge options
  5674. if (options && options._isComponent) {
  5675. // optimize internal component instantiation
  5676. // since dynamic options merging is pretty slow, and none of the
  5677. // internal component options needs special treatment.
  5678. initInternalComponent(vm, options);
  5679. } else {
  5680. vm.$options = mergeOptions(
  5681. resolveConstructorOptions(vm.constructor),
  5682. options || {},
  5683. vm
  5684. );
  5685. }
  5686. /* istanbul ignore else */
  5687. if (true) {
  5688. initProxy(vm);
  5689. } else {}
  5690. // expose real self
  5691. vm._self = vm;
  5692. initLifecycle(vm);
  5693. initEvents(vm);
  5694. initRender(vm);
  5695. callHook(vm, 'beforeCreate');
  5696. vm.mpHost !== 'mp-toutiao' && initInjections(vm); // resolve injections before data/props
  5697. initState(vm);
  5698. vm.mpHost !== 'mp-toutiao' && initProvide(vm); // resolve provide after data/props
  5699. vm.mpHost !== 'mp-toutiao' && callHook(vm, 'created');
  5700. /* istanbul ignore if */
  5701. if ( true && config.performance && mark) {
  5702. vm._name = formatComponentName(vm, false);
  5703. mark(endTag);
  5704. measure(("vue " + (vm._name) + " init"), startTag, endTag);
  5705. }
  5706. if (vm.$options.el) {
  5707. vm.$mount(vm.$options.el);
  5708. }
  5709. };
  5710. }
  5711. function initInternalComponent (vm, options) {
  5712. var opts = vm.$options = Object.create(vm.constructor.options);
  5713. // doing this because it's faster than dynamic enumeration.
  5714. var parentVnode = options._parentVnode;
  5715. opts.parent = options.parent;
  5716. opts._parentVnode = parentVnode;
  5717. var vnodeComponentOptions = parentVnode.componentOptions;
  5718. opts.propsData = vnodeComponentOptions.propsData;
  5719. opts._parentListeners = vnodeComponentOptions.listeners;
  5720. opts._renderChildren = vnodeComponentOptions.children;
  5721. opts._componentTag = vnodeComponentOptions.tag;
  5722. if (options.render) {
  5723. opts.render = options.render;
  5724. opts.staticRenderFns = options.staticRenderFns;
  5725. }
  5726. }
  5727. function resolveConstructorOptions (Ctor) {
  5728. var options = Ctor.options;
  5729. if (Ctor.super) {
  5730. var superOptions = resolveConstructorOptions(Ctor.super);
  5731. var cachedSuperOptions = Ctor.superOptions;
  5732. if (superOptions !== cachedSuperOptions) {
  5733. // super option changed,
  5734. // need to resolve new options.
  5735. Ctor.superOptions = superOptions;
  5736. // check if there are any late-modified/attached options (#4976)
  5737. var modifiedOptions = resolveModifiedOptions(Ctor);
  5738. // update base extend options
  5739. if (modifiedOptions) {
  5740. extend(Ctor.extendOptions, modifiedOptions);
  5741. }
  5742. options = Ctor.options = mergeOptions(superOptions, Ctor.extendOptions);
  5743. if (options.name) {
  5744. options.components[options.name] = Ctor;
  5745. }
  5746. }
  5747. }
  5748. return options
  5749. }
  5750. function resolveModifiedOptions (Ctor) {
  5751. var modified;
  5752. var latest = Ctor.options;
  5753. var sealed = Ctor.sealedOptions;
  5754. for (var key in latest) {
  5755. if (latest[key] !== sealed[key]) {
  5756. if (!modified) { modified = {}; }
  5757. modified[key] = latest[key];
  5758. }
  5759. }
  5760. return modified
  5761. }
  5762. function Vue (options) {
  5763. if ( true &&
  5764. !(this instanceof Vue)
  5765. ) {
  5766. warn('Vue is a constructor and should be called with the `new` keyword');
  5767. }
  5768. this._init(options);
  5769. }
  5770. initMixin(Vue);
  5771. stateMixin(Vue);
  5772. eventsMixin(Vue);
  5773. lifecycleMixin(Vue);
  5774. renderMixin(Vue);
  5775. /* */
  5776. function initUse (Vue) {
  5777. Vue.use = function (plugin) {
  5778. var installedPlugins = (this._installedPlugins || (this._installedPlugins = []));
  5779. if (installedPlugins.indexOf(plugin) > -1) {
  5780. return this
  5781. }
  5782. // additional parameters
  5783. var args = toArray(arguments, 1);
  5784. args.unshift(this);
  5785. if (typeof plugin.install === 'function') {
  5786. plugin.install.apply(plugin, args);
  5787. } else if (typeof plugin === 'function') {
  5788. plugin.apply(null, args);
  5789. }
  5790. installedPlugins.push(plugin);
  5791. return this
  5792. };
  5793. }
  5794. /* */
  5795. function initMixin$1 (Vue) {
  5796. Vue.mixin = function (mixin) {
  5797. this.options = mergeOptions(this.options, mixin);
  5798. return this
  5799. };
  5800. }
  5801. /* */
  5802. function initExtend (Vue) {
  5803. /**
  5804. * Each instance constructor, including Vue, has a unique
  5805. * cid. This enables us to create wrapped "child
  5806. * constructors" for prototypal inheritance and cache them.
  5807. */
  5808. Vue.cid = 0;
  5809. var cid = 1;
  5810. /**
  5811. * Class inheritance
  5812. */
  5813. Vue.extend = function (extendOptions) {
  5814. extendOptions = extendOptions || {};
  5815. var Super = this;
  5816. var SuperId = Super.cid;
  5817. var cachedCtors = extendOptions._Ctor || (extendOptions._Ctor = {});
  5818. if (cachedCtors[SuperId]) {
  5819. return cachedCtors[SuperId]
  5820. }
  5821. var name = extendOptions.name || Super.options.name;
  5822. if ( true && name) {
  5823. validateComponentName(name);
  5824. }
  5825. var Sub = function VueComponent (options) {
  5826. this._init(options);
  5827. };
  5828. Sub.prototype = Object.create(Super.prototype);
  5829. Sub.prototype.constructor = Sub;
  5830. Sub.cid = cid++;
  5831. Sub.options = mergeOptions(
  5832. Super.options,
  5833. extendOptions
  5834. );
  5835. Sub['super'] = Super;
  5836. // For props and computed properties, we define the proxy getters on
  5837. // the Vue instances at extension time, on the extended prototype. This
  5838. // avoids Object.defineProperty calls for each instance created.
  5839. if (Sub.options.props) {
  5840. initProps$1(Sub);
  5841. }
  5842. if (Sub.options.computed) {
  5843. initComputed$1(Sub);
  5844. }
  5845. // allow further extension/mixin/plugin usage
  5846. Sub.extend = Super.extend;
  5847. Sub.mixin = Super.mixin;
  5848. Sub.use = Super.use;
  5849. // create asset registers, so extended classes
  5850. // can have their private assets too.
  5851. ASSET_TYPES.forEach(function (type) {
  5852. Sub[type] = Super[type];
  5853. });
  5854. // enable recursive self-lookup
  5855. if (name) {
  5856. Sub.options.components[name] = Sub;
  5857. }
  5858. // keep a reference to the super options at extension time.
  5859. // later at instantiation we can check if Super's options have
  5860. // been updated.
  5861. Sub.superOptions = Super.options;
  5862. Sub.extendOptions = extendOptions;
  5863. Sub.sealedOptions = extend({}, Sub.options);
  5864. // cache constructor
  5865. cachedCtors[SuperId] = Sub;
  5866. return Sub
  5867. };
  5868. }
  5869. function initProps$1 (Comp) {
  5870. var props = Comp.options.props;
  5871. for (var key in props) {
  5872. proxy(Comp.prototype, "_props", key);
  5873. }
  5874. }
  5875. function initComputed$1 (Comp) {
  5876. var computed = Comp.options.computed;
  5877. for (var key in computed) {
  5878. defineComputed(Comp.prototype, key, computed[key]);
  5879. }
  5880. }
  5881. /* */
  5882. function initAssetRegisters (Vue) {
  5883. /**
  5884. * Create asset registration methods.
  5885. */
  5886. ASSET_TYPES.forEach(function (type) {
  5887. Vue[type] = function (
  5888. id,
  5889. definition
  5890. ) {
  5891. if (!definition) {
  5892. return this.options[type + 's'][id]
  5893. } else {
  5894. /* istanbul ignore if */
  5895. if ( true && type === 'component') {
  5896. validateComponentName(id);
  5897. }
  5898. if (type === 'component' && isPlainObject(definition)) {
  5899. definition.name = definition.name || id;
  5900. definition = this.options._base.extend(definition);
  5901. }
  5902. if (type === 'directive' && typeof definition === 'function') {
  5903. definition = { bind: definition, update: definition };
  5904. }
  5905. this.options[type + 's'][id] = definition;
  5906. return definition
  5907. }
  5908. };
  5909. });
  5910. }
  5911. /* */
  5912. function getComponentName (opts) {
  5913. return opts && (opts.Ctor.options.name || opts.tag)
  5914. }
  5915. function matches (pattern, name) {
  5916. if (Array.isArray(pattern)) {
  5917. return pattern.indexOf(name) > -1
  5918. } else if (typeof pattern === 'string') {
  5919. return pattern.split(',').indexOf(name) > -1
  5920. } else if (isRegExp(pattern)) {
  5921. return pattern.test(name)
  5922. }
  5923. /* istanbul ignore next */
  5924. return false
  5925. }
  5926. function pruneCache (keepAliveInstance, filter) {
  5927. var cache = keepAliveInstance.cache;
  5928. var keys = keepAliveInstance.keys;
  5929. var _vnode = keepAliveInstance._vnode;
  5930. for (var key in cache) {
  5931. var cachedNode = cache[key];
  5932. if (cachedNode) {
  5933. var name = getComponentName(cachedNode.componentOptions);
  5934. if (name && !filter(name)) {
  5935. pruneCacheEntry(cache, key, keys, _vnode);
  5936. }
  5937. }
  5938. }
  5939. }
  5940. function pruneCacheEntry (
  5941. cache,
  5942. key,
  5943. keys,
  5944. current
  5945. ) {
  5946. var cached$$1 = cache[key];
  5947. if (cached$$1 && (!current || cached$$1.tag !== current.tag)) {
  5948. cached$$1.componentInstance.$destroy();
  5949. }
  5950. cache[key] = null;
  5951. remove(keys, key);
  5952. }
  5953. var patternTypes = [String, RegExp, Array];
  5954. var KeepAlive = {
  5955. name: 'keep-alive',
  5956. abstract: true,
  5957. props: {
  5958. include: patternTypes,
  5959. exclude: patternTypes,
  5960. max: [String, Number]
  5961. },
  5962. created: function created () {
  5963. this.cache = Object.create(null);
  5964. this.keys = [];
  5965. },
  5966. destroyed: function destroyed () {
  5967. for (var key in this.cache) {
  5968. pruneCacheEntry(this.cache, key, this.keys);
  5969. }
  5970. },
  5971. mounted: function mounted () {
  5972. var this$1 = this;
  5973. this.$watch('include', function (val) {
  5974. pruneCache(this$1, function (name) { return matches(val, name); });
  5975. });
  5976. this.$watch('exclude', function (val) {
  5977. pruneCache(this$1, function (name) { return !matches(val, name); });
  5978. });
  5979. },
  5980. render: function render () {
  5981. var slot = this.$slots.default;
  5982. var vnode = getFirstComponentChild(slot);
  5983. var componentOptions = vnode && vnode.componentOptions;
  5984. if (componentOptions) {
  5985. // check pattern
  5986. var name = getComponentName(componentOptions);
  5987. var ref = this;
  5988. var include = ref.include;
  5989. var exclude = ref.exclude;
  5990. if (
  5991. // not included
  5992. (include && (!name || !matches(include, name))) ||
  5993. // excluded
  5994. (exclude && name && matches(exclude, name))
  5995. ) {
  5996. return vnode
  5997. }
  5998. var ref$1 = this;
  5999. var cache = ref$1.cache;
  6000. var keys = ref$1.keys;
  6001. var key = vnode.key == null
  6002. // same constructor may get registered as different local components
  6003. // so cid alone is not enough (#3269)
  6004. ? componentOptions.Ctor.cid + (componentOptions.tag ? ("::" + (componentOptions.tag)) : '')
  6005. : vnode.key;
  6006. if (cache[key]) {
  6007. vnode.componentInstance = cache[key].componentInstance;
  6008. // make current key freshest
  6009. remove(keys, key);
  6010. keys.push(key);
  6011. } else {
  6012. cache[key] = vnode;
  6013. keys.push(key);
  6014. // prune oldest entry
  6015. if (this.max && keys.length > parseInt(this.max)) {
  6016. pruneCacheEntry(cache, keys[0], keys, this._vnode);
  6017. }
  6018. }
  6019. vnode.data.keepAlive = true;
  6020. }
  6021. return vnode || (slot && slot[0])
  6022. }
  6023. };
  6024. var builtInComponents = {
  6025. KeepAlive: KeepAlive
  6026. };
  6027. /* */
  6028. function initGlobalAPI (Vue) {
  6029. // config
  6030. var configDef = {};
  6031. configDef.get = function () { return config; };
  6032. if (true) {
  6033. configDef.set = function () {
  6034. warn(
  6035. 'Do not replace the Vue.config object, set individual fields instead.'
  6036. );
  6037. };
  6038. }
  6039. Object.defineProperty(Vue, 'config', configDef);
  6040. // exposed util methods.
  6041. // NOTE: these are not considered part of the public API - avoid relying on
  6042. // them unless you are aware of the risk.
  6043. Vue.util = {
  6044. warn: warn,
  6045. extend: extend,
  6046. mergeOptions: mergeOptions,
  6047. defineReactive: defineReactive$$1
  6048. };
  6049. Vue.set = set;
  6050. Vue.delete = del;
  6051. Vue.nextTick = nextTick;
  6052. // 2.6 explicit observable API
  6053. Vue.observable = function (obj) {
  6054. observe(obj);
  6055. return obj
  6056. };
  6057. Vue.options = Object.create(null);
  6058. ASSET_TYPES.forEach(function (type) {
  6059. Vue.options[type + 's'] = Object.create(null);
  6060. });
  6061. // this is used to identify the "base" constructor to extend all plain-object
  6062. // components with in Weex's multi-instance scenarios.
  6063. Vue.options._base = Vue;
  6064. extend(Vue.options.components, builtInComponents);
  6065. initUse(Vue);
  6066. initMixin$1(Vue);
  6067. initExtend(Vue);
  6068. initAssetRegisters(Vue);
  6069. }
  6070. initGlobalAPI(Vue);
  6071. Object.defineProperty(Vue.prototype, '$isServer', {
  6072. get: isServerRendering
  6073. });
  6074. Object.defineProperty(Vue.prototype, '$ssrContext', {
  6075. get: function get () {
  6076. /* istanbul ignore next */
  6077. return this.$vnode && this.$vnode.ssrContext
  6078. }
  6079. });
  6080. // expose FunctionalRenderContext for ssr runtime helper installation
  6081. Object.defineProperty(Vue, 'FunctionalRenderContext', {
  6082. value: FunctionalRenderContext
  6083. });
  6084. Vue.version = '2.6.10';
  6085. /**
  6086. * https://raw.githubusercontent.com/Tencent/westore/master/packages/westore/utils/diff.js
  6087. */
  6088. var ARRAYTYPE = '[object Array]';
  6089. var OBJECTTYPE = '[object Object]';
  6090. // const FUNCTIONTYPE = '[object Function]'
  6091. function diff(current, pre) {
  6092. var result = {};
  6093. syncKeys(current, pre);
  6094. _diff(current, pre, '', result);
  6095. return result
  6096. }
  6097. function syncKeys(current, pre) {
  6098. if (current === pre) { return }
  6099. var rootCurrentType = type(current);
  6100. var rootPreType = type(pre);
  6101. if (rootCurrentType == OBJECTTYPE && rootPreType == OBJECTTYPE) {
  6102. if(Object.keys(current).length >= Object.keys(pre).length){
  6103. for (var key in pre) {
  6104. var currentValue = current[key];
  6105. if (currentValue === undefined) {
  6106. current[key] = null;
  6107. } else {
  6108. syncKeys(currentValue, pre[key]);
  6109. }
  6110. }
  6111. }
  6112. } else if (rootCurrentType == ARRAYTYPE && rootPreType == ARRAYTYPE) {
  6113. if (current.length >= pre.length) {
  6114. pre.forEach(function (item, index) {
  6115. syncKeys(current[index], item);
  6116. });
  6117. }
  6118. }
  6119. }
  6120. function _diff(current, pre, path, result) {
  6121. if (current === pre) { return }
  6122. var rootCurrentType = type(current);
  6123. var rootPreType = type(pre);
  6124. if (rootCurrentType == OBJECTTYPE) {
  6125. if (rootPreType != OBJECTTYPE || Object.keys(current).length < Object.keys(pre).length) {
  6126. setResult(result, path, current);
  6127. } else {
  6128. var loop = function ( key ) {
  6129. var currentValue = current[key];
  6130. var preValue = pre[key];
  6131. var currentType = type(currentValue);
  6132. var preType = type(preValue);
  6133. if (currentType != ARRAYTYPE && currentType != OBJECTTYPE) {
  6134. if (currentValue != pre[key]) {
  6135. setResult(result, (path == '' ? '' : path + ".") + key, currentValue);
  6136. }
  6137. } else if (currentType == ARRAYTYPE) {
  6138. if (preType != ARRAYTYPE) {
  6139. setResult(result, (path == '' ? '' : path + ".") + key, currentValue);
  6140. } else {
  6141. if (currentValue.length < preValue.length) {
  6142. setResult(result, (path == '' ? '' : path + ".") + key, currentValue);
  6143. } else {
  6144. currentValue.forEach(function (item, index) {
  6145. _diff(item, preValue[index], (path == '' ? '' : path + ".") + key + '[' + index + ']', result);
  6146. });
  6147. }
  6148. }
  6149. } else if (currentType == OBJECTTYPE) {
  6150. if (preType != OBJECTTYPE || Object.keys(currentValue).length < Object.keys(preValue).length) {
  6151. setResult(result, (path == '' ? '' : path + ".") + key, currentValue);
  6152. } else {
  6153. for (var subKey in currentValue) {
  6154. _diff(currentValue[subKey], preValue[subKey], (path == '' ? '' : path + ".") + key + '.' + subKey, result);
  6155. }
  6156. }
  6157. }
  6158. };
  6159. for (var key in current) loop( key );
  6160. }
  6161. } else if (rootCurrentType == ARRAYTYPE) {
  6162. if (rootPreType != ARRAYTYPE) {
  6163. setResult(result, path, current);
  6164. } else {
  6165. if (current.length < pre.length) {
  6166. setResult(result, path, current);
  6167. } else {
  6168. current.forEach(function (item, index) {
  6169. _diff(item, pre[index], path + '[' + index + ']', result);
  6170. });
  6171. }
  6172. }
  6173. } else {
  6174. setResult(result, path, current);
  6175. }
  6176. }
  6177. function setResult(result, k, v) {
  6178. // if (type(v) != FUNCTIONTYPE) {
  6179. result[k] = v;
  6180. // }
  6181. }
  6182. function type(obj) {
  6183. return Object.prototype.toString.call(obj)
  6184. }
  6185. /* */
  6186. function flushCallbacks$1(vm) {
  6187. if (vm.__next_tick_callbacks && vm.__next_tick_callbacks.length) {
  6188. if (Object({"NODE_ENV":"development","VUE_APP_PLATFORM":"mp-weixin","BASE_URL":"/"}).VUE_APP_DEBUG) {
  6189. var mpInstance = vm.$scope;
  6190. console.log('[' + (+new Date) + '][' + (mpInstance.is || mpInstance.route) + '][' + vm._uid +
  6191. ']:flushCallbacks[' + vm.__next_tick_callbacks.length + ']');
  6192. }
  6193. var copies = vm.__next_tick_callbacks.slice(0);
  6194. vm.__next_tick_callbacks.length = 0;
  6195. for (var i = 0; i < copies.length; i++) {
  6196. copies[i]();
  6197. }
  6198. }
  6199. }
  6200. function hasRenderWatcher(vm) {
  6201. return queue.find(function (watcher) { return vm._watcher === watcher; })
  6202. }
  6203. function nextTick$1(vm, cb) {
  6204. //1.nextTick 之前 已 setData 且 setData 还未回调完成
  6205. //2.nextTick 之前存在 render watcher
  6206. if (!vm.__next_tick_pending && !hasRenderWatcher(vm)) {
  6207. if(Object({"NODE_ENV":"development","VUE_APP_PLATFORM":"mp-weixin","BASE_URL":"/"}).VUE_APP_DEBUG){
  6208. var mpInstance = vm.$scope;
  6209. console.log('[' + (+new Date) + '][' + (mpInstance.is || mpInstance.route) + '][' + vm._uid +
  6210. ']:nextVueTick');
  6211. }
  6212. return nextTick(cb, vm)
  6213. }else{
  6214. if(Object({"NODE_ENV":"development","VUE_APP_PLATFORM":"mp-weixin","BASE_URL":"/"}).VUE_APP_DEBUG){
  6215. var mpInstance$1 = vm.$scope;
  6216. console.log('[' + (+new Date) + '][' + (mpInstance$1.is || mpInstance$1.route) + '][' + vm._uid +
  6217. ']:nextMPTick');
  6218. }
  6219. }
  6220. var _resolve;
  6221. if (!vm.__next_tick_callbacks) {
  6222. vm.__next_tick_callbacks = [];
  6223. }
  6224. vm.__next_tick_callbacks.push(function () {
  6225. if (cb) {
  6226. try {
  6227. cb.call(vm);
  6228. } catch (e) {
  6229. handleError(e, vm, 'nextTick');
  6230. }
  6231. } else if (_resolve) {
  6232. _resolve(vm);
  6233. }
  6234. });
  6235. // $flow-disable-line
  6236. if (!cb && typeof Promise !== 'undefined') {
  6237. return new Promise(function (resolve) {
  6238. _resolve = resolve;
  6239. })
  6240. }
  6241. }
  6242. /* */
  6243. function cloneWithData(vm) {
  6244. // 确保当前 vm 所有数据被同步
  6245. var ret = Object.create(null);
  6246. var dataKeys = [].concat(
  6247. Object.keys(vm._data || {}),
  6248. Object.keys(vm._computedWatchers || {}));
  6249. dataKeys.reduce(function(ret, key) {
  6250. ret[key] = vm[key];
  6251. return ret
  6252. }, ret);
  6253. //TODO 需要把无用数据处理掉,比如 list=>l0 则 list 需要移除,否则多传输一份数据
  6254. Object.assign(ret, vm.$mp.data || {});
  6255. if (
  6256. Array.isArray(vm.$options.behaviors) &&
  6257. vm.$options.behaviors.indexOf('uni://form-field') !== -1
  6258. ) { //form-field
  6259. ret['name'] = vm.name;
  6260. ret['value'] = vm.value;
  6261. }
  6262. return JSON.parse(JSON.stringify(ret))
  6263. }
  6264. var patch = function(oldVnode, vnode) {
  6265. var this$1 = this;
  6266. if (vnode === null) { //destroy
  6267. return
  6268. }
  6269. if (this.mpType === 'page' || this.mpType === 'component') {
  6270. var mpInstance = this.$scope;
  6271. var data = Object.create(null);
  6272. try {
  6273. data = cloneWithData(this);
  6274. } catch (err) {
  6275. console.error(err);
  6276. }
  6277. data.__webviewId__ = mpInstance.data.__webviewId__;
  6278. var mpData = Object.create(null);
  6279. Object.keys(data).forEach(function (key) { //仅同步 data 中有的数据
  6280. mpData[key] = mpInstance.data[key];
  6281. });
  6282. var diffData = diff(data, mpData);
  6283. if (Object.keys(diffData).length) {
  6284. if (Object({"NODE_ENV":"development","VUE_APP_PLATFORM":"mp-weixin","BASE_URL":"/"}).VUE_APP_DEBUG) {
  6285. console.log('[' + (+new Date) + '][' + (mpInstance.is || mpInstance.route) + '][' + this._uid +
  6286. ']差量更新',
  6287. JSON.stringify(diffData));
  6288. }
  6289. this.__next_tick_pending = true;
  6290. mpInstance.setData(diffData, function () {
  6291. this$1.__next_tick_pending = false;
  6292. flushCallbacks$1(this$1);
  6293. });
  6294. } else {
  6295. flushCallbacks$1(this);
  6296. }
  6297. }
  6298. };
  6299. /* */
  6300. function createEmptyRender() {
  6301. }
  6302. function mountComponent$1(
  6303. vm,
  6304. el,
  6305. hydrating
  6306. ) {
  6307. if (!vm.mpType) {//main.js 中的 new Vue
  6308. return vm
  6309. }
  6310. if (vm.mpType === 'app') {
  6311. vm.$options.render = createEmptyRender;
  6312. }
  6313. if (!vm.$options.render) {
  6314. vm.$options.render = createEmptyRender;
  6315. if (true) {
  6316. /* istanbul ignore if */
  6317. if ((vm.$options.template && vm.$options.template.charAt(0) !== '#') ||
  6318. vm.$options.el || el) {
  6319. warn(
  6320. 'You are using the runtime-only build of Vue where the template ' +
  6321. 'compiler is not available. Either pre-compile the templates into ' +
  6322. 'render functions, or use the compiler-included build.',
  6323. vm
  6324. );
  6325. } else {
  6326. warn(
  6327. 'Failed to mount component: template or render function not defined.',
  6328. vm
  6329. );
  6330. }
  6331. }
  6332. }
  6333. vm.mpHost !== 'mp-toutiao' && callHook(vm, 'beforeMount');
  6334. var updateComponent = function () {
  6335. vm._update(vm._render(), hydrating);
  6336. };
  6337. // we set this to vm._watcher inside the watcher's constructor
  6338. // since the watcher's initial patch may call $forceUpdate (e.g. inside child
  6339. // component's mounted hook), which relies on vm._watcher being already defined
  6340. new Watcher(vm, updateComponent, noop, {
  6341. before: function before() {
  6342. if (vm._isMounted && !vm._isDestroyed) {
  6343. callHook(vm, 'beforeUpdate');
  6344. }
  6345. }
  6346. }, true /* isRenderWatcher */);
  6347. hydrating = false;
  6348. return vm
  6349. }
  6350. /* */
  6351. function renderClass (
  6352. staticClass,
  6353. dynamicClass
  6354. ) {
  6355. if (isDef(staticClass) || isDef(dynamicClass)) {
  6356. return concat(staticClass, stringifyClass(dynamicClass))
  6357. }
  6358. /* istanbul ignore next */
  6359. return ''
  6360. }
  6361. function concat (a, b) {
  6362. return a ? b ? (a + ' ' + b) : a : (b || '')
  6363. }
  6364. function stringifyClass (value) {
  6365. if (Array.isArray(value)) {
  6366. return stringifyArray(value)
  6367. }
  6368. if (isObject(value)) {
  6369. return stringifyObject(value)
  6370. }
  6371. if (typeof value === 'string') {
  6372. return value
  6373. }
  6374. /* istanbul ignore next */
  6375. return ''
  6376. }
  6377. function stringifyArray (value) {
  6378. var res = '';
  6379. var stringified;
  6380. for (var i = 0, l = value.length; i < l; i++) {
  6381. if (isDef(stringified = stringifyClass(value[i])) && stringified !== '') {
  6382. if (res) { res += ' '; }
  6383. res += stringified;
  6384. }
  6385. }
  6386. return res
  6387. }
  6388. function stringifyObject (value) {
  6389. var res = '';
  6390. for (var key in value) {
  6391. if (value[key]) {
  6392. if (res) { res += ' '; }
  6393. res += key;
  6394. }
  6395. }
  6396. return res
  6397. }
  6398. /* */
  6399. var parseStyleText = cached(function (cssText) {
  6400. var res = {};
  6401. var listDelimiter = /;(?![^(]*\))/g;
  6402. var propertyDelimiter = /:(.+)/;
  6403. cssText.split(listDelimiter).forEach(function (item) {
  6404. if (item) {
  6405. var tmp = item.split(propertyDelimiter);
  6406. tmp.length > 1 && (res[tmp[0].trim()] = tmp[1].trim());
  6407. }
  6408. });
  6409. return res
  6410. });
  6411. // normalize possible array / string values into Object
  6412. function normalizeStyleBinding (bindingStyle) {
  6413. if (Array.isArray(bindingStyle)) {
  6414. return toObject(bindingStyle)
  6415. }
  6416. if (typeof bindingStyle === 'string') {
  6417. return parseStyleText(bindingStyle)
  6418. }
  6419. return bindingStyle
  6420. }
  6421. /* */
  6422. var MP_METHODS = ['createSelectorQuery', 'createIntersectionObserver', 'selectAllComponents', 'selectComponent'];
  6423. function getTarget(obj, path) {
  6424. var parts = path.split('.');
  6425. var key = parts[0];
  6426. if (key.indexOf('__$n') === 0) { //number index
  6427. key = parseInt(key.replace('__$n', ''));
  6428. }
  6429. if (parts.length === 1) {
  6430. return obj[key]
  6431. }
  6432. return getTarget(obj[key], parts.slice(1).join('.'))
  6433. }
  6434. function internalMixin(Vue) {
  6435. Vue.config.errorHandler = function(err) {
  6436. console.error(err);
  6437. };
  6438. var oldEmit = Vue.prototype.$emit;
  6439. Vue.prototype.$emit = function(event) {
  6440. if (this.$scope && event) {
  6441. this.$scope['triggerEvent'](event, {
  6442. __args__: toArray(arguments, 1)
  6443. });
  6444. }
  6445. return oldEmit.apply(this, arguments)
  6446. };
  6447. Vue.prototype.$nextTick = function(fn) {
  6448. return nextTick$1(this, fn)
  6449. };
  6450. MP_METHODS.forEach(function (method) {
  6451. Vue.prototype[method] = function(args) {
  6452. if (this.$scope) {
  6453. return this.$scope[method](args)
  6454. }
  6455. };
  6456. });
  6457. Vue.prototype.__init_provide = initProvide;
  6458. Vue.prototype.__init_injections = initInjections;
  6459. Vue.prototype.__call_hook = function(hook, args) {
  6460. var vm = this;
  6461. // #7573 disable dep collection when invoking lifecycle hooks
  6462. pushTarget();
  6463. var handlers = vm.$options[hook];
  6464. var info = hook + " hook";
  6465. var ret;
  6466. if (handlers) {
  6467. for (var i = 0, j = handlers.length; i < j; i++) {
  6468. ret = invokeWithErrorHandling(handlers[i], vm, args ? [args] : null, vm, info);
  6469. }
  6470. }
  6471. if (vm._hasHookEvent) {
  6472. vm.$emit('hook:' + hook);
  6473. }
  6474. popTarget();
  6475. return ret
  6476. };
  6477. Vue.prototype.__set_model = function(target, key, value, modifiers) {
  6478. if (Array.isArray(modifiers)) {
  6479. if (modifiers.indexOf('trim') !== -1) {
  6480. value = value.trim();
  6481. }
  6482. if (modifiers.indexOf('number') !== -1) {
  6483. value = this._n(value);
  6484. }
  6485. }
  6486. if (!target) {
  6487. target = this;
  6488. }
  6489. target[key] = value;
  6490. };
  6491. Vue.prototype.__set_sync = function(target, key, value) {
  6492. if (!target) {
  6493. target = this;
  6494. }
  6495. target[key] = value;
  6496. };
  6497. Vue.prototype.__get_orig = function(item) {
  6498. if (isPlainObject(item)) {
  6499. return item['$orig'] || item
  6500. }
  6501. return item
  6502. };
  6503. Vue.prototype.__get_value = function(dataPath, target) {
  6504. return getTarget(target || this, dataPath)
  6505. };
  6506. Vue.prototype.__get_class = function(dynamicClass, staticClass) {
  6507. return renderClass(staticClass, dynamicClass)
  6508. };
  6509. Vue.prototype.__get_style = function(dynamicStyle, staticStyle) {
  6510. if (!dynamicStyle && !staticStyle) {
  6511. return ''
  6512. }
  6513. var dynamicStyleObj = normalizeStyleBinding(dynamicStyle);
  6514. var styleObj = staticStyle ? extend(staticStyle, dynamicStyleObj) : dynamicStyleObj;
  6515. return Object.keys(styleObj).map(function (name) { return ((hyphenate(name)) + ":" + (styleObj[name])); }).join(';')
  6516. };
  6517. Vue.prototype.__map = function(val, iteratee) {
  6518. //TODO 暂不考虑 string,number
  6519. var ret, i, l, keys, key;
  6520. if (Array.isArray(val)) {
  6521. ret = new Array(val.length);
  6522. for (i = 0, l = val.length; i < l; i++) {
  6523. ret[i] = iteratee(val[i], i);
  6524. }
  6525. return ret
  6526. } else if (isObject(val)) {
  6527. keys = Object.keys(val);
  6528. ret = Object.create(null);
  6529. for (i = 0, l = keys.length; i < l; i++) {
  6530. key = keys[i];
  6531. ret[key] = iteratee(val[key], key, i);
  6532. }
  6533. return ret
  6534. }
  6535. return []
  6536. };
  6537. }
  6538. /* */
  6539. var LIFECYCLE_HOOKS$1 = [
  6540. //App
  6541. 'onLaunch',
  6542. 'onShow',
  6543. 'onHide',
  6544. 'onUniNViewMessage',
  6545. 'onError',
  6546. //Page
  6547. 'onLoad',
  6548. // 'onShow',
  6549. 'onReady',
  6550. // 'onHide',
  6551. 'onUnload',
  6552. 'onPullDownRefresh',
  6553. 'onReachBottom',
  6554. 'onTabItemTap',
  6555. 'onShareAppMessage',
  6556. 'onResize',
  6557. 'onPageScroll',
  6558. 'onNavigationBarButtonTap',
  6559. 'onBackPress',
  6560. 'onNavigationBarSearchInputChanged',
  6561. 'onNavigationBarSearchInputConfirmed',
  6562. 'onNavigationBarSearchInputClicked',
  6563. //Component
  6564. // 'onReady', // 兼容旧版本,应该移除该事件
  6565. 'onPageShow',
  6566. 'onPageHide',
  6567. 'onPageResize'
  6568. ];
  6569. function lifecycleMixin$1(Vue) {
  6570. //fixed vue-class-component
  6571. var oldExtend = Vue.extend;
  6572. Vue.extend = function(extendOptions) {
  6573. extendOptions = extendOptions || {};
  6574. var methods = extendOptions.methods;
  6575. if (methods) {
  6576. Object.keys(methods).forEach(function (methodName) {
  6577. if (LIFECYCLE_HOOKS$1.indexOf(methodName)!==-1) {
  6578. extendOptions[methodName] = methods[methodName];
  6579. delete methods[methodName];
  6580. }
  6581. });
  6582. }
  6583. return oldExtend.call(this, extendOptions)
  6584. };
  6585. var strategies = Vue.config.optionMergeStrategies;
  6586. var mergeHook = strategies.created;
  6587. LIFECYCLE_HOOKS$1.forEach(function (hook) {
  6588. strategies[hook] = mergeHook;
  6589. });
  6590. Vue.prototype.__lifecycle_hooks__ = LIFECYCLE_HOOKS$1;
  6591. }
  6592. /* */
  6593. // install platform patch function
  6594. Vue.prototype.__patch__ = patch;
  6595. // public mount method
  6596. Vue.prototype.$mount = function(
  6597. el ,
  6598. hydrating
  6599. ) {
  6600. return mountComponent$1(this, el, hydrating)
  6601. };
  6602. lifecycleMixin$1(Vue);
  6603. internalMixin(Vue);
  6604. /* */
  6605. /* harmony default export */ __webpack_exports__["default"] = (Vue);
  6606. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../../../../webpack/buildin/global.js */ 3)))
  6607. /***/ }),
  6608. /* 3 */
  6609. /*!***********************************!*\
  6610. !*** (webpack)/buildin/global.js ***!
  6611. \***********************************/
  6612. /*! no static exports found */
  6613. /***/ (function(module, exports) {
  6614. var g;
  6615. // This works in non-strict mode
  6616. g = (function() {
  6617. return this;
  6618. })();
  6619. try {
  6620. // This works if eval is allowed (see CSP)
  6621. g = g || new Function("return this")();
  6622. } catch (e) {
  6623. // This works if the window reference is available
  6624. if (typeof window === "object") g = window;
  6625. }
  6626. // g can still be undefined, but nothing to do about it...
  6627. // We return undefined, instead of nothing here, so it's
  6628. // easier to handle this case. if(!global) { ...}
  6629. module.exports = g;
  6630. /***/ }),
  6631. /* 4 */
  6632. /*!*************************************************************!*\
  6633. !*** C:/Users/lenovo/Desktop/新建文件夹/gaobaoUniApp/pages.json ***!
  6634. \*************************************************************/
  6635. /*! no static exports found */
  6636. /***/ (function(module, exports, __webpack_require__) {
  6637. "use strict";
  6638. /***/ }),
  6639. /* 5 */,
  6640. /* 6 */,
  6641. /* 7 */,
  6642. /* 8 */,
  6643. /* 9 */,
  6644. /* 10 */
  6645. /*!********************************************************************!*\
  6646. !*** ./node_modules/vue-loader/lib/runtime/componentNormalizer.js ***!
  6647. \********************************************************************/
  6648. /*! exports provided: default */
  6649. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  6650. "use strict";
  6651. __webpack_require__.r(__webpack_exports__);
  6652. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return normalizeComponent; });
  6653. /* globals __VUE_SSR_CONTEXT__ */
  6654. // IMPORTANT: Do NOT use ES2015 features in this file (except for modules).
  6655. // This module is a runtime utility for cleaner component module output and will
  6656. // be included in the final webpack user bundle.
  6657. function normalizeComponent (
  6658. scriptExports,
  6659. render,
  6660. staticRenderFns,
  6661. functionalTemplate,
  6662. injectStyles,
  6663. scopeId,
  6664. moduleIdentifier, /* server only */
  6665. shadowMode /* vue-cli only */
  6666. ) {
  6667. // Vue.extend constructor export interop
  6668. var options = typeof scriptExports === 'function'
  6669. ? scriptExports.options
  6670. : scriptExports
  6671. // render functions
  6672. if (render) {
  6673. options.render = render
  6674. options.staticRenderFns = staticRenderFns
  6675. options._compiled = true
  6676. }
  6677. // functional template
  6678. if (functionalTemplate) {
  6679. options.functional = true
  6680. }
  6681. // scopedId
  6682. if (scopeId) {
  6683. options._scopeId = 'data-v-' + scopeId
  6684. }
  6685. var hook
  6686. if (moduleIdentifier) { // server build
  6687. hook = function (context) {
  6688. // 2.3 injection
  6689. context =
  6690. context || // cached call
  6691. (this.$vnode && this.$vnode.ssrContext) || // stateful
  6692. (this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext) // functional
  6693. // 2.2 with runInNewContext: true
  6694. if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') {
  6695. context = __VUE_SSR_CONTEXT__
  6696. }
  6697. // inject component styles
  6698. if (injectStyles) {
  6699. injectStyles.call(this, context)
  6700. }
  6701. // register component module identifier for async chunk inferrence
  6702. if (context && context._registeredComponents) {
  6703. context._registeredComponents.add(moduleIdentifier)
  6704. }
  6705. }
  6706. // used by ssr in case component is cached and beforeCreate
  6707. // never gets called
  6708. options._ssrRegister = hook
  6709. } else if (injectStyles) {
  6710. hook = shadowMode
  6711. ? function () { injectStyles.call(this, this.$root.$options.shadowRoot) }
  6712. : injectStyles
  6713. }
  6714. if (hook) {
  6715. if (options.functional) {
  6716. // for template-only hot-reload because in that case the render fn doesn't
  6717. // go through the normalizer
  6718. options._injectStyles = hook
  6719. // register for functioal component in vue file
  6720. var originalRender = options.render
  6721. options.render = function renderWithStyleInjection (h, context) {
  6722. hook.call(context)
  6723. return originalRender(h, context)
  6724. }
  6725. } else {
  6726. // inject component registration as beforeCreate hook
  6727. var existing = options.beforeCreate
  6728. options.beforeCreate = existing
  6729. ? [].concat(existing, hook)
  6730. : [hook]
  6731. }
  6732. }
  6733. return {
  6734. exports: scriptExports,
  6735. options: options
  6736. }
  6737. }
  6738. /***/ }),
  6739. /* 11 */
  6740. /*!*******************************************************************************************!*\
  6741. !*** C:/Users/lenovo/Desktop/新建文件夹/gaobaoUniApp/main.js?{"page":"pages%2Findex%2Findex"} ***!
  6742. \*******************************************************************************************/
  6743. /*! no static exports found */
  6744. /***/ (function(module, exports, __webpack_require__) {
  6745. "use strict";
  6746. /* WEBPACK VAR INJECTION */(function(createPage) {__webpack_require__(/*! uni-pages */ 4);
  6747. var _vue = _interopRequireDefault(__webpack_require__(/*! vue */ 2));
  6748. var _index = _interopRequireDefault(__webpack_require__(/*! ./pages/index/index.vue */ 12));function _interopRequireDefault(obj) {return obj && obj.__esModule ? obj : { default: obj };}
  6749. createPage(_index.default);
  6750. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./node_modules/@dcloudio/uni-mp-weixin/dist/index.js */ 1)["createPage"]))
  6751. /***/ })
  6752. ]]);
  6753. //# sourceMappingURL=../../.sourcemap/mp-weixin/common/vendor.js.map