mirror of
https://gitee.com/vant-contrib/vant.git
synced 2026-04-30 02:18:15 +08:00
Compare commits
2 Commits
38856e2e1c
...
34f389917f
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
34f389917f | ||
|
|
c608f15f47 |
@ -58,9 +58,16 @@ export function PopupMixin(options = {}) {
|
||||
}),
|
||||
],
|
||||
|
||||
provide() {
|
||||
return {
|
||||
vanPopup: this,
|
||||
};
|
||||
},
|
||||
|
||||
props: popupMixinProps,
|
||||
|
||||
data() {
|
||||
this.onReopenCallback = [];
|
||||
return {
|
||||
inited: this.value,
|
||||
};
|
||||
@ -135,6 +142,9 @@ export function PopupMixin(options = {}) {
|
||||
this.opened = true;
|
||||
this.renderOverlay();
|
||||
this.addLock();
|
||||
this.onReopenCallback.forEach((callback) => {
|
||||
callback();
|
||||
});
|
||||
},
|
||||
|
||||
addLock() {
|
||||
@ -220,6 +230,10 @@ export function PopupMixin(options = {}) {
|
||||
updateZIndex(value = 0) {
|
||||
this.$el.style.zIndex = ++context.zIndex + value;
|
||||
},
|
||||
|
||||
onReopen(callback) {
|
||||
this.onReopenCallback.push(callback);
|
||||
},
|
||||
},
|
||||
};
|
||||
}
|
||||
|
||||
@ -14,6 +14,12 @@ export default createComponent({
|
||||
}),
|
||||
],
|
||||
|
||||
inject: {
|
||||
vanPopup: {
|
||||
default: null,
|
||||
},
|
||||
},
|
||||
|
||||
props: {
|
||||
text: String,
|
||||
mode: String,
|
||||
@ -53,6 +59,15 @@ export default createComponent({
|
||||
},
|
||||
},
|
||||
|
||||
created() {
|
||||
// https://github.com/youzan/vant/issues/8634
|
||||
if (this.vanPopup) {
|
||||
this.vanPopup.onReopen(() => {
|
||||
this.start();
|
||||
});
|
||||
}
|
||||
},
|
||||
|
||||
activated() {
|
||||
this.start();
|
||||
},
|
||||
|
||||
@ -42,6 +42,12 @@ export default createComponent({
|
||||
}),
|
||||
],
|
||||
|
||||
inject: {
|
||||
vanPopup: {
|
||||
default: null,
|
||||
},
|
||||
},
|
||||
|
||||
model: {
|
||||
prop: 'active',
|
||||
},
|
||||
@ -171,6 +177,13 @@ export default createComponent({
|
||||
|
||||
mounted() {
|
||||
this.init();
|
||||
|
||||
// https://github.com/youzan/vant/issues/7959
|
||||
if (this.vanPopup) {
|
||||
this.vanPopup.onReopen(() => {
|
||||
this.setLine();
|
||||
});
|
||||
}
|
||||
},
|
||||
|
||||
activated() {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user