mirror of
https://github.com/Tencent/tmagic-editor.git
synced 2025-04-06 03:57:56 +08:00
fix(form): select下拉列表分页不生效问题
This commit is contained in:
parent
fcb69b7743
commit
8edf023a00
@ -26,7 +26,7 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script lang="ts" setup name="MFormSelect">
|
<script lang="ts" setup name="MFormSelect">
|
||||||
import { inject, nextTick, onBeforeMount, onMounted, Ref, ref, watchEffect } from 'vue';
|
import { inject, onBeforeMount, Ref, ref, watch, watchEffect } from 'vue';
|
||||||
|
|
||||||
import { TMagicSelect } from '@tmagic/design';
|
import { TMagicSelect } from '@tmagic/design';
|
||||||
|
|
||||||
@ -331,10 +331,14 @@ if (typeof props.config.options === 'function') {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
props.config.remote &&
|
if (props.config.remote) {
|
||||||
onMounted(async () => {
|
const unWacth = watch(
|
||||||
await nextTick();
|
() => tMagicSelect.value?.scrollbarWrap,
|
||||||
tMagicSelect.value?.scrollbarWrap?.addEventListener('scroll', async (e: Event) => {
|
(scrollbarWrap) => {
|
||||||
|
if (!scrollbarWrap) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
scrollbarWrap.addEventListener('scroll', async (e: Event) => {
|
||||||
const el = e.currentTarget as HTMLDivElement;
|
const el = e.currentTarget as HTMLDivElement;
|
||||||
if (moreLoadingVisible.value) {
|
if (moreLoadingVisible.value) {
|
||||||
return;
|
return;
|
||||||
@ -350,7 +354,13 @@ props.config.remote &&
|
|||||||
options.value = await getOptions();
|
options.value = await getOptions();
|
||||||
moreLoadingVisible.value = false;
|
moreLoadingVisible.value = false;
|
||||||
});
|
});
|
||||||
});
|
unWacth();
|
||||||
|
},
|
||||||
|
{
|
||||||
|
immediate: true,
|
||||||
|
},
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
const popperClass = mForm?.popperClass;
|
const popperClass = mForm?.popperClass;
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user