@tarojs/runtime 3.7.0-alpha.6 → 3.7.0-alpha.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -5,7 +5,6 @@ import { ComponentOptions, VNode } from "vue";
5
5
  import { Component as Vue3Component } from "@vue/runtime-core";
6
6
  import { Component, ComponentClass } from "react";
7
7
  import { CombinedVueInstance } from "vue/types/vue";
8
- declare let document: any;
9
8
  declare class ClassList {
10
9
  private el;
11
10
  private tokenList;
@@ -104,70 +103,6 @@ declare class TaroText extends TaroNode {
104
103
  set data(text: string);
105
104
  get data(): string;
106
105
  }
107
- // Taro 事件对象。以 Web 标准的事件对象为基础,加入小程序事件对象中携带的部分信息,并模拟实现事件冒泡。
108
- declare class TaroEvent {
109
- private cacheTarget;
110
- private cacheCurrentTarget;
111
- type: string;
112
- bubbles: boolean;
113
- cancelable: boolean;
114
- _stop: boolean;
115
- _end: boolean;
116
- defaultPrevented: boolean;
117
- // Mouse Event botton property, it's used in 3rd lib, like react-router. default 0 in general
118
- button: number;
119
- // timestamp can either be hi-res ( relative to page load) or low-res (relative to UNIX epoch)
120
- // here use hi-res timestamp
121
- timeStamp: number;
122
- mpEvent: MpEvent | undefined;
123
- constructor(type: string, opts: EventOptions, event?: MpEvent);
124
- stopPropagation(): void;
125
- stopImmediatePropagation(): void;
126
- preventDefault(): void;
127
- get target(): any;
128
- get currentTarget(): any;
129
- }
130
- declare function createEvent(event: MpEvent | string, node?: TaroElement): TaroEvent;
131
- // 小程序的事件代理回调函数
132
- declare function eventHandler(event: MpEvent): any;
133
- declare class FormElement extends TaroElement {
134
- get type(): string;
135
- set type(val: string);
136
- get value(): string | boolean | number | any[];
137
- set value(val: string | boolean | number | any[]);
138
- dispatchEvent(event: TaroEvent): boolean;
139
- }
140
- declare class TaroRootElement extends TaroElement {
141
- private updatePayloads;
142
- private updateCallbacks;
143
- pendingUpdate: boolean;
144
- ctx: null | MpInstance;
145
- constructor();
146
- get _path(): string;
147
- get _root(): TaroRootElement;
148
- enqueueUpdate(payload: UpdatePayload): void;
149
- performUpdate(initRender?: boolean, prerender?: Func): void;
150
- enqueueUpdateCallback(cb: Func, ctx?: Record<string, any>): void;
151
- flushUpdateCallback(): void;
152
- }
153
- declare class TaroDocument extends TaroElement {
154
- documentElement: TaroElement;
155
- head: TaroElement;
156
- body: TaroElement;
157
- createEvent: typeof createEvent;
158
- constructor();
159
- createElement(type: string): TaroElement | TaroRootElement | FormElement;
160
- // an ugly fake createElementNS to deal with @vue/runtime-dom's
161
- // support mounting app to svg container since vue@3.0.8
162
- createElementNS(_svgNS: string, type: string): TaroElement | TaroRootElement | FormElement;
163
- createTextNode(text: string): TaroText;
164
- getElementById<T extends TaroElement>(id: string | undefined | null): T | null;
165
- querySelector<T extends TaroElement>(query: string): T | null;
166
- querySelectorAll(): never[];
167
- // @TODO: @PERF: 在 hydrate 移除掉空的 node
168
- createComment(): TaroText;
169
- get defaultView(): any;
170
- }
171
106
  interface Node {
172
107
  type: string;
173
108
  }
@@ -207,6 +142,19 @@ declare class TaroEventTarget {
207
142
  removeEventListener(type: string, handler: EventHandler): void;
208
143
  isAnyEventBinded(): boolean;
209
144
  }
145
+ declare class TaroRootElement extends TaroElement {
146
+ private updatePayloads;
147
+ private updateCallbacks;
148
+ pendingUpdate: boolean;
149
+ ctx: null | MpInstance;
150
+ constructor();
151
+ get _path(): string;
152
+ get _root(): TaroRootElement;
153
+ enqueueUpdate(payload: UpdatePayload): void;
154
+ performUpdate(initRender?: boolean, prerender?: Func): void;
155
+ enqueueUpdateCallback(cb: Func, ctx?: Record<string, any>): void;
156
+ flushUpdateCallback(): void;
157
+ }
210
158
  interface RemoveChildOptions {
211
159
  cleanRef?: boolean;
212
160
  doUpdate?: boolean;
@@ -290,7 +238,34 @@ declare class Style {
290
238
  removeProperty(propertyName: string): string;
291
239
  getPropertyValue(propertyName: string): any;
292
240
  }
241
+ // Taro 事件对象。以 Web 标准的事件对象为基础,加入小程序事件对象中携带的部分信息,并模拟实现事件冒泡。
242
+ declare class TaroEvent {
243
+ private cacheTarget;
244
+ private cacheCurrentTarget;
245
+ type: string;
246
+ bubbles: boolean;
247
+ cancelable: boolean;
248
+ _stop: boolean;
249
+ _end: boolean;
250
+ defaultPrevented: boolean;
251
+ // Mouse Event botton property, it's used in 3rd lib, like react-router. default 0 in general
252
+ button: number;
253
+ // timestamp can either be hi-res ( relative to page load) or low-res (relative to UNIX epoch)
254
+ // here use hi-res timestamp
255
+ timeStamp: number;
256
+ mpEvent: MpEvent | undefined;
257
+ constructor(type: string, opts: EventOptions, event?: MpEvent);
258
+ stopPropagation(): void;
259
+ stopImmediatePropagation(): void;
260
+ preventDefault(): void;
261
+ get target(): any;
262
+ get currentTarget(): any;
263
+ }
264
+ declare function createEvent(event: MpEvent | string, node?: TaroElement): TaroEvent;
265
+ // 小程序的事件代理回调函数
266
+ declare function eventHandler(event: MpEvent): any;
293
267
  declare class TaroElement extends TaroNode {
268
+ ctx?: any;
294
269
  tagName: string;
295
270
  props: Record<string, any>;
296
271
  style: Style;
@@ -324,6 +299,37 @@ declare class TaroElement extends TaroNode {
324
299
  removeEventListener(type: any, handler: any, sideEffect?: boolean): void;
325
300
  static extend(methodName: string, options: Func | Record<string, any>): void;
326
301
  }
302
+ declare class FormElement extends TaroElement {
303
+ get type(): string;
304
+ set type(val: string);
305
+ get value(): string | boolean | number | any[];
306
+ set value(val: string | boolean | number | any[]);
307
+ dispatchEvent(event: TaroEvent): boolean;
308
+ }
309
+ declare class TaroDocument extends TaroElement {
310
+ documentElement: TaroElement;
311
+ head: TaroElement;
312
+ body: TaroElement;
313
+ createEvent: typeof createEvent;
314
+ constructor();
315
+ createElement(type: string): TaroElement | TaroRootElement | FormElement;
316
+ // an ugly fake createElementNS to deal with @vue/runtime-dom's
317
+ // support mounting app to svg container since vue@3.0.8
318
+ createElementNS(_svgNS: string, type: string): TaroElement | TaroRootElement | FormElement;
319
+ createTextNode(text: string): TaroText;
320
+ getElementById<T extends TaroElement>(id: string | undefined | null): T | null;
321
+ querySelector<T extends TaroElement>(query: string): T | null;
322
+ querySelectorAll(): never[];
323
+ // @TODO: @PERF: 在 hydrate 移除掉空的 node
324
+ createComment(): TaroText;
325
+ get defaultView(): any;
326
+ }
327
+ interface Env {
328
+ window: any;
329
+ document: TaroDocument;
330
+ }
331
+ declare const env: Env;
332
+ declare let document: any;
327
333
  declare function getComputedStyle(element: TaroElement): Style;
328
334
  declare const eventCenter: Events;
329
335
  type EventsType = typeof Events;
@@ -583,8 +589,67 @@ declare class MutationObserver {
583
589
  takeRecords(): MutationRecord[];
584
590
  static record(record: MutationRecord): void;
585
591
  }
592
+ declare const PROPERTY_THRESHOLD = 2046;
593
+ declare const TARO_RUNTIME = "Taro runtime";
594
+ declare const HOOKS_APP_ID = "taro-app";
595
+ declare const SET_DATA = "\u5C0F\u7A0B\u5E8F setData";
596
+ declare const PAGE_INIT = "\u9875\u9762\u521D\u59CB\u5316";
597
+ declare const ROOT_STR = "root";
598
+ declare const HTML = "html";
599
+ declare const HEAD = "head";
600
+ declare const BODY = "body";
601
+ declare const APP = "app";
602
+ declare const CONTAINER = "container";
603
+ declare const DOCUMENT_ELEMENT_NAME = "#document";
604
+ declare const DOCUMENT_FRAGMENT = "document-fragment";
605
+ declare const ID = "id";
606
+ declare const UID = "uid";
607
+ declare const CLASS = "class";
608
+ declare const STYLE = "style";
609
+ declare const FOCUS = "focus";
610
+ declare const VIEW = "view";
611
+ declare const STATIC_VIEW = "static-view";
612
+ declare const PURE_VIEW = "pure-view";
613
+ declare const PROPS = "props";
614
+ declare const DATASET = "dataset";
615
+ declare const OBJECT = "object";
616
+ declare const VALUE = "value";
617
+ declare const INPUT = "input";
618
+ declare const CHANGE = "change";
619
+ declare const CUSTOM_WRAPPER = "custom-wrapper";
620
+ declare const TARGET = "target";
621
+ declare const CURRENT_TARGET = "currentTarget";
622
+ declare const TYPE = "type";
623
+ declare const CONFIRM = "confirm";
624
+ declare const TIME_STAMP = "timeStamp";
625
+ declare const KEY_CODE = "keyCode";
626
+ declare const TOUCHMOVE = "touchmove";
627
+ declare const DATE = "Date";
628
+ declare const SET_TIMEOUT = "setTimeout";
629
+ declare const CATCHMOVE = "catchMove";
630
+ declare const CATCH_VIEW = "catch-view";
631
+ declare const COMMENT = "comment";
632
+ declare const ON_LOAD = "onLoad";
633
+ declare const ON_READY = "onReady";
634
+ declare const ON_SHOW = "onShow";
635
+ declare const ON_HIDE = "onHide";
636
+ declare const OPTIONS = "options";
637
+ declare const EXTERNAL_CLASSES = "externalClasses";
638
+ declare const EVENT_CALLBACK_RESULT = "e_result";
639
+ declare const BEHAVIORS = "behaviors";
640
+ declare const A = "a";
641
+ /**
642
+ * 页面上下文切换时的行为
643
+ */
644
+ declare enum CONTEXT_ACTIONS {
645
+ INIT = "0",
646
+ RESTORE = "1",
647
+ RECOVER = "2",
648
+ DESTORY = "3"
649
+ }
586
650
  interface Instance<T = Record<string, any>> extends Component<T>, Show, PageInstance {
587
651
  tid?: string;
652
+ node?: TaroElement;
588
653
  $forceUpdate?(): void;
589
654
  $nextTick?(cb: () => void): void;
590
655
  $options: Instance;
@@ -656,6 +721,7 @@ interface Show {
656
721
  interface AppInstance extends Show {
657
722
  componentDidShow?(options?: Record<string, unknown>): void;
658
723
  mount?(component: React.ComponentClass | ComponentOptions<VueCtor> | Vue3Component, id: string, cb: (...args: any[]) => void): void;
724
+ mount?(component: React.ComponentClass | ComponentOptions<VueCtor> | Vue3Component, id: string, getCtx: (...args: any[]) => void, cb: (...args: any[]) => void): void;
659
725
  onError?(error: string): void;
660
726
  onLaunch?(options?: Record<string, unknown>): void;
661
727
  onPageNotFound?(res: any): void;
@@ -694,6 +760,9 @@ declare function addLeadingSlash(path?: string): string;
694
760
  declare function safeExecute(path: string, lifecycle: string, ...args: unknown[]): any;
695
761
  declare function stringify(obj?: Record<string, unknown>): string;
696
762
  declare function getPath(id: string, options?: Record<string, unknown>): string;
763
+ declare function getOnReadyEventKey(path: string): string;
764
+ declare function getOnShowEventKey(path: string): string;
765
+ declare function getOnHideEventKey(path: string): string;
697
766
  declare function createPageConfig(component: any, pageName?: string, data?: Record<string, unknown>, pageConfig?: PageConfig): PageInstance;
698
767
  declare function createComponentConfig(component: React.ComponentClass, componentName?: string, data?: Record<string, unknown>): any;
699
768
  declare function createRecursiveComponentConfig(componentName?: string): any;
@@ -707,5 +776,23 @@ declare function hydrate(node: TaroElement | TaroText): MiniData;
707
776
  declare const nextTick: (cb: Func, ctx?: Record<string, any>) => void;
708
777
  declare const options: Options;
709
778
  declare const incrementId: () => () => string;
779
+ declare function isElement(node: TaroNode): node is TaroElement;
780
+ declare function isText(node: TaroNode): node is TaroText;
781
+ declare function isComment(node: TaroNode): boolean;
782
+ declare function isHasExtractProp(el: TaroElement): boolean;
783
+ /**
784
+ * 往上寻找组件树直到 root,寻找是否有祖先组件绑定了同类型的事件
785
+ * @param node 当前组件
786
+ * @param type 事件类型
787
+ */
788
+ declare function isParentBinded(node: TaroElement | null, type: string): boolean;
789
+ declare function shortcutAttr(key: string): string;
790
+ declare const customWrapperCache: Map<string, Record<string, any>>;
791
+ interface Ctor {
792
+ new (...args: any[]): any;
793
+ }
794
+ declare function extend(ctor: Ctor, methodName: string, options: Func | Record<string, any>): void;
795
+ declare function getComponentsAlias(): any;
796
+ declare function convertNumber2PX(value: number): string;
710
797
  export { hooks } from '@tarojs/shared';
711
- export { document, getComputedStyle, History, Location, nav as navigator, _caf as cancelAnimationFrame, now, _raf as requestAnimationFrame, parseUrl, URL, URLSearchParams, history, location, window, TaroElement, createEvent, eventHandler, TaroEvent, FormElement, TaroNode, TaroRootElement, Style, SVGElement, TaroText, MutationObserver, Current, getCurrentInstance, eventSource, addLeadingSlash, createComponentConfig, createPageConfig, createRecursiveComponentConfig, getPageInstance, getPath, injectPageInstance, removePageInstance, safeExecute, stringify, EventsType, eventCenter, Events, hydrate, nextTick, options, incrementId, Instance, VueAppInstance, VueInstance, PageProps, ReactPageComponent, ReactPageInstance, ReactAppInstance, PageLifeCycle, PageInstance, AppInstance, Attributes, EventOptions, MpEvent, EventListenerOptions, AddEventListenerOptions, EventHandler, MpInstance, MiniElementData, MiniData, HydratedData, UpdatePayloadValue, DataTree, UpdatePayload, Options$0 as Options, Func, Ctx };
798
+ export { document, getComputedStyle, History, Location, nav as navigator, _caf as cancelAnimationFrame, now, _raf as requestAnimationFrame, parseUrl, URL, URLSearchParams, history, location, window, TaroElement, createEvent, eventHandler, TaroEvent, FormElement, TaroNode, TaroRootElement, Style, SVGElement, TaroText, MutationObserver, env, PROPERTY_THRESHOLD, TARO_RUNTIME, HOOKS_APP_ID, SET_DATA, PAGE_INIT, ROOT_STR, HTML, HEAD, BODY, APP, CONTAINER, DOCUMENT_ELEMENT_NAME, DOCUMENT_FRAGMENT, ID, UID, CLASS, STYLE, FOCUS, VIEW, STATIC_VIEW, PURE_VIEW, PROPS, DATASET, OBJECT, VALUE, INPUT, CHANGE, CUSTOM_WRAPPER, TARGET, CURRENT_TARGET, TYPE, CONFIRM, TIME_STAMP, KEY_CODE, TOUCHMOVE, DATE, SET_TIMEOUT, CATCHMOVE, CATCH_VIEW, COMMENT, ON_LOAD, ON_READY, ON_SHOW, ON_HIDE, OPTIONS, EXTERNAL_CLASSES, EVENT_CALLBACK_RESULT, BEHAVIORS, A, CONTEXT_ACTIONS, Current, getCurrentInstance, eventSource, addLeadingSlash, createComponentConfig, createPageConfig, createRecursiveComponentConfig, getOnHideEventKey, getOnReadyEventKey, getOnShowEventKey, getPageInstance, getPath, injectPageInstance, removePageInstance, safeExecute, stringify, EventsType, eventCenter, Events, hydrate, nextTick, options, incrementId, isElement, isText, isComment, isHasExtractProp, isParentBinded, shortcutAttr, customWrapperCache, extend, getComponentsAlias, convertNumber2PX, Instance, VueAppInstance, VueInstance, PageProps, ReactPageComponent, ReactPageInstance, ReactAppInstance, PageLifeCycle, PageInstance, AppInstance, Attributes, EventOptions, MpEvent, EventListenerOptions, AddEventListenerOptions, EventHandler, MpInstance, MiniElementData, MiniData, HydratedData, UpdatePayloadValue, DataTree, UpdatePayload, Options$0 as Options, Func, Ctx };
@@ -2,6 +2,8 @@ import { noop, isFunction, getComponentsAlias as getComponentsAlias$1, internalC
2
2
  export { Events, hooks } from '@tarojs/shared';
3
3
 
4
4
  const PROPERTY_THRESHOLD = 2046;
5
+ const TARO_RUNTIME = 'Taro runtime';
6
+ const HOOKS_APP_ID = 'taro-app';
5
7
  const SET_DATA = '小程序 setData';
6
8
  const PAGE_INIT = '页面初始化';
7
9
  const ROOT_STR = 'root';
@@ -34,6 +36,8 @@ const CONFIRM = 'confirm';
34
36
  const TIME_STAMP = 'timeStamp';
35
37
  const KEY_CODE = 'keyCode';
36
38
  const TOUCHMOVE = 'touchmove';
39
+ const DATE = 'Date';
40
+ const SET_TIMEOUT = 'setTimeout';
37
41
  const CATCHMOVE = 'catchMove';
38
42
  const CATCH_VIEW = 'catch-view';
39
43
  const COMMENT = 'comment';
@@ -282,6 +286,9 @@ function getComponentsAlias() {
282
286
  }
283
287
  return componentsAlias$1;
284
288
  }
289
+ function convertNumber2PX(value) {
290
+ return value + 'px';
291
+ }
285
292
 
286
293
  class ClassList {
287
294
  constructor(className, el) {
@@ -403,6 +410,7 @@ let componentsAlias;
403
410
  * it's a vnode traverser and modifier: that's exactly what Taro's doing in here.
404
411
  */
405
412
  function hydrate(node) {
413
+ var _a;
406
414
  if (!componentsAlias) {
407
415
  // 初始化 componentsAlias
408
416
  componentsAlias = getComponentsAlias();
@@ -415,7 +423,7 @@ function hydrate(node) {
415
423
  if (isText(node)) {
416
424
  return {
417
425
  ["v" /* Shortcuts.Text */]: node.nodeValue,
418
- ["nn" /* Shortcuts.NodeName */]: componentsAlias[nodeName]._num
426
+ ["nn" /* Shortcuts.NodeName */]: ((_a = componentsAlias[nodeName]) === null || _a === void 0 ? void 0 : _a._num) || '8'
419
427
  };
420
428
  }
421
429
  const data = {
@@ -2462,13 +2470,13 @@ class TaroEvent {
2462
2470
  this.defaultPrevented = true;
2463
2471
  }
2464
2472
  get target() {
2465
- var _a, _b;
2473
+ var _a, _b, _c;
2466
2474
  const cacheTarget = this.cacheTarget;
2467
2475
  if (!cacheTarget) {
2468
2476
  const target = Object.create(((_a = this.mpEvent) === null || _a === void 0 ? void 0 : _a.target) || null);
2469
- const element = env.document.getElementById(target.id);
2477
+ const element = env.document.getElementById(((_b = target.dataset) === null || _b === void 0 ? void 0 : _b.sid) || target.id || null);
2470
2478
  target.dataset = element !== null ? element.dataset : EMPTY_OBJ;
2471
- for (const key in (_b = this.mpEvent) === null || _b === void 0 ? void 0 : _b.detail) {
2479
+ for (const key in (_c = this.mpEvent) === null || _c === void 0 ? void 0 : _c.detail) {
2472
2480
  target[key] = this.mpEvent.detail[key];
2473
2481
  }
2474
2482
  this.cacheTarget = target;
@@ -2479,19 +2487,19 @@ class TaroEvent {
2479
2487
  }
2480
2488
  }
2481
2489
  get currentTarget() {
2482
- var _a, _b, _c, _d;
2490
+ var _a, _b, _c, _d, _e, _f, _g, _h;
2483
2491
  const cacheCurrentTarget = this.cacheCurrentTarget;
2484
2492
  if (!cacheCurrentTarget) {
2485
2493
  const doc = env.document;
2486
2494
  const currentTarget = Object.create(((_a = this.mpEvent) === null || _a === void 0 ? void 0 : _a.currentTarget) || null);
2487
- const element = doc.getElementById(currentTarget.id);
2488
- const targetElement = doc.getElementById(((_c = (_b = this.mpEvent) === null || _b === void 0 ? void 0 : _b.target) === null || _c === void 0 ? void 0 : _c.id) || null);
2495
+ const element = doc.getElementById(((_b = currentTarget.dataset) === null || _b === void 0 ? void 0 : _b.sid) || currentTarget.id || null);
2496
+ const targetElement = doc.getElementById(((_e = (_d = (_c = this.mpEvent) === null || _c === void 0 ? void 0 : _c.target) === null || _d === void 0 ? void 0 : _d.dataset) === null || _e === void 0 ? void 0 : _e.sid) || ((_g = (_f = this.mpEvent) === null || _f === void 0 ? void 0 : _f.target) === null || _g === void 0 ? void 0 : _g.id) || null);
2489
2497
  if (element === null || (element && element === targetElement)) {
2490
2498
  this.cacheCurrentTarget = this.target;
2491
2499
  return this.target;
2492
2500
  }
2493
2501
  currentTarget.dataset = element.dataset;
2494
- for (const key in (_d = this.mpEvent) === null || _d === void 0 ? void 0 : _d.detail) {
2502
+ for (const key in (_h = this.mpEvent) === null || _h === void 0 ? void 0 : _h.detail) {
2495
2503
  currentTarget[key] = this.mpEvent.detail[key];
2496
2504
  }
2497
2505
  this.cacheCurrentTarget = currentTarget;
@@ -3240,9 +3248,6 @@ class AnchorElement extends TaroElement {
3240
3248
  }
3241
3249
  }
3242
3250
 
3243
- class CustomWrapperElement extends TaroElement {
3244
- }
3245
-
3246
3251
  class TaroDocument extends TaroElement {
3247
3252
  constructor() {
3248
3253
  super();
@@ -3263,9 +3268,6 @@ class TaroDocument extends TaroElement {
3263
3268
  case nodeName === A:
3264
3269
  element = new AnchorElement();
3265
3270
  break;
3266
- case nodeName === CUSTOM_WRAPPER:
3267
- element = new CustomWrapperElement();
3268
- break;
3269
3271
  default:
3270
3272
  element = new TaroElement();
3271
3273
  break;
@@ -4056,8 +4058,19 @@ function createPageConfig(component, pageName, data, pageConfig) {
4056
4058
  }
4057
4059
  };
4058
4060
  LIFECYCLES.forEach((lifecycle) => {
4061
+ let isDefer = false;
4062
+ lifecycle = lifecycle.replace(/^defer:/, () => {
4063
+ isDefer = true;
4064
+ return '';
4065
+ });
4059
4066
  config[lifecycle] = function () {
4060
- return safeExecute(this.$taroPath, lifecycle, ...arguments);
4067
+ const exec = () => safeExecute(this.$taroPath, lifecycle, ...arguments);
4068
+ if (isDefer) {
4069
+ hasLoaded.then(exec);
4070
+ }
4071
+ else {
4072
+ return exec();
4073
+ }
4061
4074
  };
4062
4075
  });
4063
4076
  // onShareAppMessage 和 onShareTimeline 一样,会影响小程序右上方按钮的选项,因此不能默认注册。
@@ -4096,7 +4109,8 @@ function createComponentConfig(component, componentName, data) {
4096
4109
  [ATTACHED]() {
4097
4110
  var _a;
4098
4111
  perf.start(PAGE_INIT);
4099
- const path = getPath(id, { id: ((_a = this.getPageId) === null || _a === void 0 ? void 0 : _a.call(this)) || pageId() });
4112
+ this.pageIdCache = ((_a = this.getPageId) === null || _a === void 0 ? void 0 : _a.call(this)) || pageId();
4113
+ const path = getPath(id, { id: this.pageIdCache });
4100
4114
  Current.app.mount(component, path, () => {
4101
4115
  componentElement = env.document.getElementById(path);
4102
4116
  ensure(componentElement !== null, '没有找到组件实例。');
@@ -4109,7 +4123,7 @@ function createComponentConfig(component, componentName, data) {
4109
4123
  });
4110
4124
  },
4111
4125
  [DETACHED]() {
4112
- const path = getPath(id, { id: this.getPageId() });
4126
+ const path = getPath(id, { id: this.pageIdCache });
4113
4127
  Current.app.unmount(path, () => {
4114
4128
  instances.delete(path);
4115
4129
  if (componentElement) {
@@ -4220,5 +4234,5 @@ const nextTick = (cb, ctx) => {
4220
4234
  next();
4221
4235
  };
4222
4236
 
4223
- export { Current, FormElement, History, Location, MutationObserver, SVGElement, Style, TaroElement, TaroEvent, TaroNode, TaroRootElement, TaroText, URL, URLSearchParams, addLeadingSlash, _caf as cancelAnimationFrame, createComponentConfig, createEvent, createPageConfig, createRecursiveComponentConfig, document$1 as document, eventCenter, eventHandler, eventSource, getComputedStyle, getCurrentInstance, getPageInstance, getPath, history, hydrate, incrementId, injectPageInstance, location, nav as navigator, nextTick, now, options, parseUrl, removePageInstance, _raf as requestAnimationFrame, safeExecute, stringify, window$1 as window };
4237
+ export { A, APP, BEHAVIORS, BODY, CATCHMOVE, CATCH_VIEW, CHANGE, CLASS, COMMENT, CONFIRM, CONTAINER, CONTEXT_ACTIONS, CURRENT_TARGET, CUSTOM_WRAPPER, Current, DATASET, DATE, DOCUMENT_ELEMENT_NAME, DOCUMENT_FRAGMENT, EVENT_CALLBACK_RESULT, EXTERNAL_CLASSES, FOCUS, FormElement, HEAD, HOOKS_APP_ID, HTML, History, ID, INPUT, KEY_CODE, Location, MutationObserver, OBJECT, ON_HIDE, ON_LOAD, ON_READY, ON_SHOW, OPTIONS, PAGE_INIT, PROPERTY_THRESHOLD, PROPS, PURE_VIEW, ROOT_STR, SET_DATA, SET_TIMEOUT, STATIC_VIEW, STYLE, SVGElement, Style, TARGET, TARO_RUNTIME, TIME_STAMP, TOUCHMOVE, TYPE, TaroElement, TaroEvent, TaroNode, TaroRootElement, TaroText, UID, URL, URLSearchParams, VALUE, VIEW, addLeadingSlash, _caf as cancelAnimationFrame, convertNumber2PX, createComponentConfig, createEvent, createPageConfig, createRecursiveComponentConfig, customWrapperCache, document$1 as document, env, eventCenter, eventHandler, eventSource, extend, getComponentsAlias, getComputedStyle, getCurrentInstance, getOnHideEventKey, getOnReadyEventKey, getOnShowEventKey, getPageInstance, getPath, history, hydrate, incrementId, injectPageInstance, isComment, isElement, isHasExtractProp, isParentBinded, isText, location, nav as navigator, nextTick, now, options, parseUrl, removePageInstance, _raf as requestAnimationFrame, safeExecute, shortcutAttr, stringify, window$1 as window };
4224
4238
  //# sourceMappingURL=runtime.esm.js.map