|
|
@@ -62,6 +62,7 @@ const props = withDefaults(defineProps<CascadePickerProps>(), {
|
|
|
|
|
|
const pickerVisibleCols = ref<CascadePickerItem[][]>([]);
|
|
|
const pickerSelectIndex = ref<number[]>([]);
|
|
|
+const currentText = ref<string>('');
|
|
|
|
|
|
function bindChange(e: any) {
|
|
|
const val = e.detail.value as number[];
|
|
|
@@ -94,6 +95,7 @@ function bindChange(e: any) {
|
|
|
|
|
|
emit('update:value', resultValue);
|
|
|
emit('selectTextChange', selectText.join(' '));
|
|
|
+ currentText.value = selectText.join(' ');
|
|
|
}
|
|
|
function loadCols() {
|
|
|
const selectText : string[] = [];
|
|
|
@@ -111,6 +113,7 @@ function loadCols() {
|
|
|
}
|
|
|
}
|
|
|
emit('selectTextChange', selectText.join(' '), true);
|
|
|
+ currentText.value = selectText.join(' ');
|
|
|
}
|
|
|
|
|
|
watch(() => props.value, (v) => {
|
|
|
@@ -120,6 +123,11 @@ onMounted(() => {
|
|
|
loadCols();
|
|
|
})
|
|
|
|
|
|
+defineExpose({
|
|
|
+ getSelectedText: () => {
|
|
|
+ return currentText.value;
|
|
|
+ },
|
|
|
+});
|
|
|
defineOptions({
|
|
|
options: {
|
|
|
styleIsolation: "shared",
|