Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
setChildCtrl(ctrl) {
if (this.mdc) {
this.mdc.destroy();
}
if (ctrl && ctrl.mdc) {
this.mdc = new MDCFormField(this.$element[0]);
this.mdc.input = ctrl.mdc;
}
}
mounted: function() {
this.mdcFormField = new MDCFormField(this.$el);
}
};
mounted() {
this.mdcFormField = new MDCFormField(this.$el)
},
destroyed() {
installed() {
const radio = new MDCRadio(this.shadowRoot.querySelector('.mdc-radio'))
const formField = new MDCFormField(this.shadowRoot.querySelector('.mdc-form-field'))
formField.input = radio
this.radio = radio
this.group = this.getScopeRoot(this.shadowRoot.host).querySelectorAll(`m-radio[name='${this.props.name}']`)
//fix group 不一致
this.group.forEach(ele => {
ele.group = this.group
})
}
installed() {
const checkbox = new MDCCheckbox(this.shadowRoot.querySelector('.mdc-checkbox'))
const formField = new MDCFormField(this.shadowRoot.querySelector('.mdc-form-field'))
formField.input = checkbox
}