Skip to content

Commit

Permalink
fix(ActionSheet): move initialization to observer for better visibili…
Browse files Browse the repository at this point in the history
…ty handling
  • Loading branch information
betavs committed Jan 8, 2025
1 parent bf78ec4 commit 4bf8e47
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions src/action-sheet/action-sheet.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,13 @@ export default class ActionSheet extends SuperComponent {
},
];

ready() {
this.memoInitialData();
this.splitGridThemeActions();
}
observers = {
visible(value: boolean) {
if (!value) return;
this.memoInitialData();
this.splitGridThemeActions();
},
};

methods = {
onSwiperChange(e: WechatMiniprogram.TouchEvent) {
Expand All @@ -65,7 +68,6 @@ export default class ActionSheet extends SuperComponent {
...options,
visible: true,
});
this.splitGridThemeActions();
this.autoClose = true;
this._trigger('visible-change', { visible: true });
},
Expand Down

0 comments on commit 4bf8e47

Please sign in to comment.