File tree Expand file tree Collapse file tree 1 file changed +9
-4
lines changed Expand file tree Collapse file tree 1 file changed +9
-4
lines changed Original file line number Diff line number Diff line change 3939 <a-auto-complete
4040 class =" detail-input"
4141 ref =" keyElm"
42- :filterOption =" filterOption"
42+ :filterOption =" (input, option) => filterOption(input, option, 'key') "
4343 v-model:value =" newKey"
4444 :options =" detailKeys"
4545 :placeholder =" $t('label.name')"
5151 disabled />
5252 <a-auto-complete
5353 class =" detail-input"
54- :filterOption =" filterOption"
54+ :filterOption =" (input, option) => filterOption(input, option, 'value') "
5555 v-model:value =" newValue"
5656 :options =" detailValues"
5757 :placeholder =" $t('label.value')"
@@ -176,7 +176,7 @@ export default {
176176 if (this .detailOptions [this .newKey ]) {
177177 return { value: this .detailOptions [this .newKey ] }
178178 } else {
179- return ' '
179+ return []
180180 }
181181 }
182182 return this .detailOptions [this .newKey ].map (value => {
@@ -188,7 +188,12 @@ export default {
188188 this .updateResource (this .resource )
189189 },
190190 methods: {
191- filterOption (input , option ) {
191+ filterOption (input , option , filterType ) {
192+ if ((filterType === ' key' && ! this .newKey ) ||
193+ (filterType === ' value' && ! this .newValue )) {
194+ return true
195+ }
196+
192197 return (
193198 option .value .toUpperCase ().indexOf (input .toUpperCase ()) >= 0
194199 )
You can’t perform that action at this time.
0 commit comments