mirror of
https://github.com/youzan/vant.git
synced 2025-10-19 18:14:13 +00:00
[Improvement] Actionsheet: support lazy render (#1365)
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
<template>
|
||||
<transition :name="currentTransition">
|
||||
<div v-if="inited || !lazyRender" v-show="value" :class="b({ [position]: position })">
|
||||
<div v-if="shouldRender" v-show="value" :class="b({ [position]: position })">
|
||||
<slot />
|
||||
</div>
|
||||
</transition>
|
||||
@@ -17,10 +17,6 @@ export default create({
|
||||
|
||||
props: {
|
||||
transition: String,
|
||||
lazyRender: {
|
||||
type: Boolean,
|
||||
default: true
|
||||
},
|
||||
overlay: {
|
||||
type: Boolean,
|
||||
default: true
|
||||
@@ -35,22 +31,10 @@ export default create({
|
||||
}
|
||||
},
|
||||
|
||||
data() {
|
||||
return {
|
||||
inited: this.value
|
||||
};
|
||||
},
|
||||
|
||||
computed: {
|
||||
currentTransition() {
|
||||
return this.transition || (this.position === '' ? 'van-fade' : `popup-slide-${this.position}`);
|
||||
}
|
||||
},
|
||||
|
||||
watch: {
|
||||
value() {
|
||||
this.inited = this.inited || this.value;
|
||||
}
|
||||
}
|
||||
});
|
||||
</script>
|
||||
|
Reference in New Issue
Block a user