更新插件组件文档,调整多个组件以支持关闭功能,增强用户交互体验,并修正配置示例以反映最新的代码结构和依赖关系。

This commit is contained in:
jxxghp
2025-05-07 08:21:44 +08:00
parent d3a6703a77
commit d3f9c04209
8 changed files with 85 additions and 296 deletions

View File

@@ -99,6 +99,7 @@
<v-spacer></v-spacer>
<v-btn color="secondary" variant="outlined" @click="resetForm">重置</v-btn>
<v-btn color="primary" :disabled="!isFormValid" @click="saveConfig" :loading="saving">保存配置</v-btn>
<v-btn color="primary" @click="notifyClose">关闭</v-btn>
</v-card-actions>
</v-card>
</div>
@@ -113,6 +114,10 @@ const props = defineProps({
type: Object,
default: () => ({}),
},
api: {
type: any,
default: () => {},
},
})
// 表单状态
@@ -162,7 +167,7 @@ onMounted(() => {
})
// 自定义事件,用于保存配置
const emit = defineEmits(['save'])
const emit = defineEmits(['save', 'close', 'switch'])
// 保存配置
async function saveConfig() {
@@ -198,6 +203,11 @@ function resetForm() {
form.value.resetValidation()
}
}
// 通知主应用关闭组件
function notifyClose() {
emit('close')
}
</script>
<style scoped>