vendor.js 214 KB

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