You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// Assuming you have a data structure to store selected options
data() {
return {
selectedOptions: [],
unselectedOptions: [],
customInput: '', // Input for adding custom values
};
},
methods: {
// Function to handle adding custom values to selected options
addCustomValue() {
if (this.customInput.trim() !== '') {
this.selectedOptions.push(this.customInput.trim());
this.customInput = ''; // Clear the input field
}
},
// Function to handle removing selected options
removeSelectedOption(index) {
this.selectedOptions.splice(index, 1);
},
// Function to handle keypress event (Enter key)
handleKeyPress(event) {
if (event.key === 'Enter') {
this.addCustomValue();
}
},
},
Please add selectedoptions and unselectedoptions to scope so it will be easy to add data from input to selected. Thank you
The text was updated successfully, but these errors were encountered: