fix(confilg-template): build template error #989

This commit is contained in:
Jacky 2025-04-27 09:22:14 +08:00
parent 70fe8fdec1
commit 28ed291250
No known key found for this signature in database
GPG key ID: 215C21B10DF38B4D
3 changed files with 9 additions and 11 deletions

View file

@ -3,7 +3,7 @@ import type { Variable } from '@/api/template'
import TemplateFormItem from './TemplateFormItem.vue'
const data = defineModel<Record<string, Variable>>({
default: () => {},
default: reactive({}),
})
</script>

View file

@ -8,8 +8,8 @@ export const useConfigTemplateStore = defineStore('configTemplate', () => {
const variables = computed(() => data.value?.variables ?? {})
function __buildTemplate(name: string) {
template.build_block(name, variables.value).then(r => {
function __buildTemplate() {
template.build_block(data.value.filename, variables.value).then(r => {
data.value.directives = r.directives
data.value.locations = r.locations
data.value.custom = r.custom