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 input = this.$el.parentElement.previousElementSibling.querySelector('.mdc-text-field__input')
if (input instanceof HTMLInputElement) {
if (this.currentLength === 0) this.cl = input.value.length
if (this.maxLength === 0) this.ml = input.getAttribute('maxlength')
}
if (!(this.getCharacterCounter instanceof Function)) { // can not be init by parent
this.mdcTextFieldCharacterCounter = MDCTextFieldCharacterCounter.attachTo(this.$el)
this.mdcTextFieldCharacterCounter.foundation.setCounterValue(this.cl, this.ml)
}
},
methods: {