feat: base xtSelect支持延迟加载
This commit is contained in:
parent
a40dd9079a
commit
0febf3f507
|
|
@ -69,7 +69,7 @@
|
|||
</template>
|
||||
|
||||
<script setup>
|
||||
import { ref, defineProps, defineEmits, computed, onMounted } from "vue";
|
||||
import { ref, defineProps, defineEmits, computed, onMounted, watch } from "vue";
|
||||
|
||||
const props = defineProps({
|
||||
multiple: { type: Boolean, default: false },
|
||||
|
|
@ -103,7 +103,24 @@ onMounted(() => {
|
|||
tableData.value = props.options;
|
||||
hidePagination.value = true;
|
||||
}
|
||||
watch(
|
||||
() => props.label,
|
||||
async (newVal) => {
|
||||
init()
|
||||
},
|
||||
{ deep: true, immediate: true }
|
||||
);
|
||||
watch(
|
||||
() => props.modelValue,
|
||||
async (newVal) => {
|
||||
init()
|
||||
},
|
||||
{ deep: true, immediate: true }
|
||||
)
|
||||
|
||||
});
|
||||
|
||||
const init = () => {
|
||||
if (props.label) {
|
||||
selectLabel.value = props.label;
|
||||
} else {
|
||||
|
|
@ -133,7 +150,7 @@ onMounted(() => {
|
|||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
const isFixOptions = ref(false);
|
||||
const tableData = ref(null);
|
||||
|
|
|
|||
Loading…
Reference in New Issue