I am currently using the Chosen library on Vue and Webpack for my project. I have a scenario where I need to cancel a selection when multiple options are selected, but I am struggling to achieve this. Can anyone guide me on how to cancel a selected option?
<script>
import $ from 'jquery';
window.$ = window.jQuery = $;
import chosen from 'chosen-js';
import 'chosen-js/chosen.css';
export default {
mounted: function() {
$('.select').chosen({
width: '100%',
}).change(function(ev, result) {
if (result.selected === 'aaa') {
// TODO: cancel selected
console.log('selected', result.selected);
}
});
},
};
</script>
<template>
<select class="select" multiple>
<option>aaa</option>
<option>bbb</option>
<option>ccc</option>
</select>
</template>