File tree Expand file tree Collapse file tree 1 file changed +4
-13
lines changed
src/components/pivottable-ui Expand file tree Collapse file tree 1 file changed +4
-13
lines changed Original file line number Diff line number Diff line change 44 class =" pvtDropdown"
55 >
66 <option
7- v-for =" (text, key ) in options"
8- :key =" key "
7+ v-for =" (text, index ) in options"
8+ :key =" index "
99 :value =" text"
1010 >
1111 {{ text }}
@@ -22,23 +22,14 @@ const emit = defineEmits<{
2222
2323interface DropdownProps {
2424 options: string []
25- value: string
25+ value? : string
2626}
2727
2828const props = withDefaults (defineProps <DropdownProps >(), {
29- options : () => [],
3029 value: ' '
3130})
3231
33- const valueModel = ref <string >(' ' )
34-
35- watch (
36- [() => props .value , () => props .options ],
37- ([val , opts ]: [string , string []]) => {
38- valueModel .value = val || opts [0 ] || ' '
39- },
40- { immediate: true }
41- )
32+ const valueModel = ref <string >(props .value || props .options [0 ] || ' ' )
4233
4334watch (
4435 valueModel ,
You can’t perform that action at this time.
0 commit comments