Refactor #4953 - For Chips

This commit is contained in:
mertsincan 2024-02-02 15:46:45 +00:00
parent 66966bbb17
commit 11a22a2e0a

View file

@ -67,12 +67,20 @@ export default {
emits: ['update:modelValue', 'add', 'remove', 'focus', 'blur'], emits: ['update:modelValue', 'add', 'remove', 'focus', 'blur'],
data() { data() {
return { return {
id: UniqueComponentId(), id: this.$attrs.id,
inputValue: null, inputValue: null,
focused: false, focused: false,
focusedIndex: null focusedIndex: null
}; };
}, },
watch: {
'$attrs.id': function (newValue) {
this.id = newValue || UniqueComponentId();
}
},
mounted() {
this.id = this.id || UniqueComponentId();
},
methods: { methods: {
onWrapperClick() { onWrapperClick() {
this.$refs.input.focus(); this.$refs.input.focus();