How to use the @material/select.MDCSelect.attachTo function in @material/select

To help you get started, we’ve selected a few @material/select examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github rx / presenters / views / mdc / assets / js / components / selects.js View on Github external
export function initSelects() {
    console.log('\tSelects');
    var components = document.querySelectorAll('.mdc-select');
    for (var i = 0; i < components.length; i++) {
        var component = components[i];
        if (!component.vComponent) {
            component.vComponent = new VSelect(component, MDCSelect.attachTo(component));
        }
    }
}
github matsp / material-components-vue / components / select / Select.vue View on Github external
mounted () {
    this.mdcSelect = MDCSelect.attachTo(this.$el)
    this.mdcSelect.valid = this.valid
    this.mdcSelect.required = this.required
    this.slotObserver = new MutationObserver(() => this.updateSlots())
    this.slotObserver.observe(this.$el, {
      childList: true,
      subtree: true
    })
    this.updateSlots()
  },
  beforeDestroy () {