feat:目录选择组件

This commit is contained in:
jxxghp
2024-05-31 20:35:57 +08:00
parent a475a3b851
commit f29f408b67
4 changed files with 35 additions and 18 deletions

View File

@@ -17,6 +17,9 @@ const props = defineProps({
height: String,
})
//
const path = ref<string>('')
//
const typeItems = [
{ title: '全部', value: '' },
@@ -25,13 +28,19 @@ const typeItems = [
]
//
const emit = defineEmits(['close', 'changed'])
const emit = defineEmits(['close', 'changed', 'update:modelValue'])
//
function onClose() {
emit('close')
}
//
function updatePath(value: string) {
path.value = value
emit('update:modelValue', value)
}
//
const getCategories = computed(() => {
const default_value = [{ title: '全部', value: '' }]
@@ -60,7 +69,11 @@ const getCategories = computed(() => {
<VForm>
<VRow>
<VCol>
<VTextField v-model="props.directory.path" variant="underlined" label="路径" />
<VPathField @update:modelValue="updatePath">
<template #activator="{ menuprops }">
<VTextField v-model="props.directory.path" v-bind="menuprops" variant="underlined" label="路径" />
</template>
</VPathField>
</VCol>
</VRow>
<VRow>