Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
mounted() {
const {
INTERACTION_EVENT,
SELECTION_EVENT,
REMOVAL_EVENT,
TRAILING_ICON_INTERACTION_EVENT,
PRIMARY_ACTION_SELECTOR,
TRAILING_ACTION_SELECTOR,
NAVIGATION_EVENT,
} = MDCChipFoundation.strings;
this.trailingAction_ = this.$el.querySelector(TRAILING_ACTION_SELECTOR);
this.foundation = new MDCChipFoundation({
addClass: className => this.$set(this.classes, className, true),
removeClass: className => this.$delete(this.classes, className),
hasClass: className => this.$el.classList.contains(className),
addClassToLeadingIcon: className => {
this.$set(this.leadingClasses, className, true);
// if no ref, then using slot, so just add class directly
if (!this.$refs['leading-icon'] && this.haveleadingIcon) {
const item = this.$slots['leading-icon'][0];
(item.elm || item).classList.add(className);
}
},
import MDCChipSetFoundation from '@material/chips/chip-set/foundation';
import { MDCChipFoundation } from '@material/chips/chip/foundation';
const {
INTERACTION_EVENT,
SELECTION_EVENT,
REMOVAL_EVENT,
NAVIGATION_EVENT,
} = MDCChipFoundation.strings;
const { CHIP_SELECTOR } = MDCChipSetFoundation.strings;
let idCounter = 0;
export default {
name: 'mcw-chip-set',
props: {
choice: [Boolean],
filter: [Boolean],
input: [Boolean],
},
provide() {
return { mcwChipSet: this };
},
data() {