fix(design): element-plus@2.2.22开始scrollbar.wrap$改成wrapRef

This commit is contained in:
roymondchen 2023-02-21 17:18:09 +08:00
parent 174695b94c
commit 62038c8c60

View File

@ -14,7 +14,7 @@
</template>
<script setup lang="ts" name="TMSelect">
import { computed, onMounted, ref } from 'vue';
import { computed, ref, watch } from 'vue';
import { getConfig } from './config';
@ -55,9 +55,19 @@ const visibleHandler = (...args: any[]) => {
const scrollbarWrap = ref<HTMLDivElement | undefined>();
onMounted(() => {
scrollbarWrap.value = select.value?.scrollbar?.wrap$;
});
const unWacth = watch(
() => select.value?.scrollbar?.wrap$ || select.value?.scrollbar?.wrapRef,
(wrap) => {
if (!wrap) {
return;
}
scrollbarWrap.value = wrap;
unWacth();
},
{
immediate: true,
},
);
defineExpose({
scrollbarWrap,