bkui-vue3
bkui-vue3 copied to clipboard
bugfix(sidesslider): 侧栏弹窗异常
Version / Branch / tag
出了什么问题?(What Happened?)
如何复现?(How to reproduce?)
<template>
<div style="position: relative;margin: 100px;">
<bk-button @click="handleOpenSlider">
默认配置
</bk-button>
<div v-if="isShow">
<bk-sideslider
v-model:isShow="isShow"
title="我是标题"
quick-close
/>
</div>
</div>
</template>
<script>
import { defineComponent, nextTick, ref } from 'vue';
export default defineComponent({
name: 'SiteSideslider',
setup() {
const isShow = ref(false);
const isShow2 = ref(false);
const handleOpenSlider = () => {
isShow.value = !isShow.value;
nextTick(() => {
isShow2.value = isShow.value;
});
};
return {
handleOpenSlider,
isShow,
isShow2,
};
},
});
</script>
预期结果(What you expect?) 正常
<template>
<div style="position: relative;margin: 100px;">
<bk-button @click="handleOpenSlider">
默认配置
</bk-button>
<div v-if="isShow">
<bk-sideslider
v-model:isShow="isShow2"
title="我是标题"
quick-close
/>
</div>
</div>
</template>
<script>
import { defineComponent, nextTick, ref } from 'vue';
export default defineComponent({
name: 'SiteSideslider',
setup() {
const isShow = ref(false);
const isShow2 = ref(false);
const handleOpenSlider = () => {
isShow.value = !isShow.value;
nextTick(() => {
isShow2.value = isShow.value;
});
};
return {
handleOpenSlider,
isShow,
isShow2,
};
},
});
</script>
是否可以这样改?