Closed 497363983 closed 3 months ago
以下是一个复现案例,当点击Add按钮向ref数组中添加选项,视图中选项并未添加。
Add
ref
<script lang="ts" setup> import { onMounted, ref } from "vue" import { FormSelect, FormSelectOption, Button } from "@kousum/semi-ui-vue" defineProps<{ field: string label?: string }>() onMounted(() => { console.log("tableMetaList", tableMetaList) }) const testOption = ref<string[]>([]) const add = () => { testOption.value.push("test" + testOption.value.length) console.log("testOption", testOption.value) } </script> <template> <FormSelect :field="field" :label="label" :value="'test'" > <template v-for="item in testOption" > <FormSelectOption :value="item"> {{ item }} </FormSelectOption> </template> </FormSelect> <Button @click="add">Add</Button> </template>
已更新至0.12.0
以下是一个复现案例,当点击
Add
按钮向ref
数组中添加选项,视图中选项并未添加。