Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
mounted() {
window.addEventListener('keydown', this.handleKeydownEvent);
this.foundation = new MDCSnackbarFoundation({
addClass: className => this.$set(this.classes, className, true),
removeClass: className => this.$delete(this.classes, className),
announce: () => this.announce(this.$refs.labelEl),
notifyOpening: () =>
this.$emit(MDCSnackbarFoundation.strings.OPENING_EVENT, {}),
notifyOpened: () => {
this.$emit(MDCSnackbarFoundation.strings.OPENED_EVENT, {});
this.$emit('change', true);
this.$emit('show', {});
},
notifyClosing: reason =>
this.$emit(
MDCSnackbarFoundation.strings.CLOSING_EVENT,
reason ? { reason } : {},
),
notifyClosed: reason => {
this.$emit('change', true);
this.$emit('show', {});
},
notifyClosing: reason => {
this.$emit(strings.CLOSING_EVENT, reason ? { reason } : {});
this.$emit('update:reason', reason);
},
notifyClosed: reason => {
this.$emit(strings.CLOSED_EVENT, reason ? { reason } : {});
this.$emit('change', false);
this.$emit('hide');
},
};
const { closeOnEscape, timeoutMs } = this;
this.foundation = new MDCSnackbarFoundation(adapter);
this.foundation.init();
if (timeoutMs !== void 0) {
this.foundation.setTimeoutMs(timeoutMs);
}
this.foundation.setCloseOnEscape(closeOnEscape);
},
computed: {