refactor(modules/web): Mirgrat to typescript; fix bugs
This commit is contained in:
@@ -14,7 +14,7 @@
|
||||
id,
|
||||
array,
|
||||
hint,
|
||||
required,
|
||||
required = false,
|
||||
} in children"
|
||||
:label="title"
|
||||
:key="title"
|
||||
@@ -35,20 +35,26 @@
|
||||
autosize
|
||||
/>
|
||||
|
||||
<el-switch v-if="type == 'Boolean'" v-model="currentSource[id]" />
|
||||
<el-switch
|
||||
v-if="(type as string) === 'Boolean'"
|
||||
v-model="currentSource[id]"
|
||||
/>
|
||||
|
||||
<el-input-number
|
||||
v-if="type == 'Number'"
|
||||
v-if="(type as string) === 'Number'"
|
||||
v-model="currentSource[id]"
|
||||
:min="0"
|
||||
/>
|
||||
|
||||
<el-select v-if="type == 'Array'" v-model="currentSource[id]">
|
||||
<el-select
|
||||
v-if="(type as string) === 'Array'"
|
||||
v-model="currentSource[id]"
|
||||
>
|
||||
<el-option
|
||||
v-for="(name, index) in array"
|
||||
v-for="(optionName, index) in array"
|
||||
:value="index"
|
||||
:key="name"
|
||||
:label="name"
|
||||
:key="optionName"
|
||||
:label="optionName"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
@@ -57,11 +63,13 @@
|
||||
</el-tabs>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
const store = useSourceStore();
|
||||
defineProps(["config"]);
|
||||
<script setup lang="ts">
|
||||
import type { SourceConfig } from '@/config/sourceConfig'
|
||||
|
||||
const currentSource = computed(() => store.currentSource);
|
||||
const store = useSourceStore()
|
||||
defineProps<{ config: SourceConfig }>()
|
||||
|
||||
const currentSource = computed(() => store.currentSource)
|
||||
/*
|
||||
修改currentSource的属性 没有直接修改本身
|
||||
const { currentSource } = storeToRefs(store);
|
||||
|
||||
Reference in New Issue
Block a user