inviton-powerduck 0.0.21 → 0.0.22

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.
@@ -216,8 +216,8 @@ export abstract class PowerduckViewModelBase extends Vue {
216
216
  }
217
217
 
218
218
  unwrapRootElement(): HTMLElement {
219
- if ((this.$el as any).$childSlots != null) {
220
- return ((this.$el as any).$childSlots[0]?.el || this.$el) as any;
219
+ if ((this.$el as any).$getChildSlots != null) {
220
+ return (((this.$el as any).$getChildSlots() || [])[0]?.el || this.$el) as any;
221
221
  }
222
222
 
223
223
  return this.$el as any;
@@ -14,17 +14,25 @@ interface TeleportArgs {
14
14
  })
15
15
  class TeleportComponent extends TsxComponent<TeleportArgs> implements TeleportArgs {
16
16
  @Prop() to!: string;
17
+ _currentSlots: any = null;
17
18
 
18
19
 
19
- render() {
20
- const childSlots = this.$slots.default?.();
21
- this.$nextTick(() => {
22
- this.$el.$childSlots = childSlots;
23
- })
20
+ beforeUnmount() {
21
+ this.$el.$getChildSlots = null;
22
+ this._currentSlots = null;
23
+ }
24
24
 
25
+ render() {
26
+ this._currentSlots = this.$slots.default?.();
27
+ if (this.$el == null || this.$el.$getChildSlots == null) {
28
+ this.$nextTick(() => {
29
+ this.$el.$getChildSlots = () => this._currentSlots;
30
+ })
31
+ }
32
+
25
33
  return (
26
34
  <teleport to={this.to}>
27
- {childSlots}
35
+ {this._currentSlots}
28
36
  </teleport>
29
37
  );
30
38
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "inviton-powerduck",
3
- "version": "0.0.21",
3
+ "version": "0.0.22",
4
4
  "type": "module",
5
5
  "scripts": {
6
6
  "build": " vite build && vue-tsc --declaration --emitDeclarationOnly",