🐛(dropdown): 根据 issues 修复 dropdown 内容切换宽度计算不正确的问题

This commit is contained in:
就眠儀式 2022-11-10 15:20:39 +08:00
parent cc1f6de1b5
commit b9f258f645
2 changed files with 5 additions and 5 deletions

View File

@ -573,7 +573,7 @@ onClickOutside(dropdownRef, (e) => {
hide(); hide();
}); });
const onlyChildRenderFunc = () => { const onlyChildRenderFunc = computed(() => {
const slotContent = slots.default ? slots.default() : []; const slotContent = slots.default ? slots.default() : [];
const transformedSlotContent = slotContent.map((vnode) => const transformedSlotContent = slotContent.map((vnode) =>
cloneVNode( cloneVNode(
@ -592,8 +592,8 @@ const onlyChildRenderFunc = () => {
); );
children.value = transformedSlotContent; children.value = transformedSlotContent;
return h(Fragment, children.value); return () => h(Fragment, children.value);
}; });
onMounted(() => { onMounted(() => {
if (props.updateAtScroll) { if (props.updateAtScroll) {

View File

@ -27,7 +27,7 @@ function add(arg1: number, arg2: number) {
arg2 = Number(arg2.toString().replace(".", "")); arg2 = Number(arg2.toString().replace(".", ""));
} }
return (arg1 + arg2) / m; return (arg1 + arg2) / m;
}; }
//减法 //减法
function sub(arg1: number, arg2: number) { function sub(arg1: number, arg2: number) {
var r1, r2, m, c; var r1, r2, m, c;
@ -57,5 +57,5 @@ function sub(arg1: number, arg2: number) {
arg2 = Number(arg2.toString().replace(".", "")); arg2 = Number(arg2.toString().replace(".", ""));
} }
return (arg1 - arg2) / m; return (arg1 - arg2) / m;
}; }
export { add, sub }; export { add, sub };