How to use the @material/menu-surface.MDCMenuSurface.attachTo function in @material/menu-surface

To help you get started, we’ve selected a few @material/menu-surface 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 matsp / material-components-vue / components / menu / MenuSurface.vue View on Github external
this.$nextTick(() => {
      this.mdcMenuSurface = MDCMenuSurface.attachTo(this.$el)
      this.mdcMenuSurface.setFixedPosition(this.fixed)
      if (this._anchorCorner) {
        this.mdcMenuSurface.setAnchorCorner(this._anchorCorner)
      }
      if (this.absolutePositionX !== null || this.absolutePositionY !== null) {
        this.mdcMenuSurface.setAbsolutePosition(this.absolutePositionX, this.absolutePositionY)
      }
      if (this.hoistToBody) {
        this.mdcMenuSurface.hoistMenuToBody()
      }
      this.mdcMenuSurface.setIsHoisted(this.isHoisted)

      this.open ? this.mdcMenuSurface.getDefaultFoundation().open() : this.mdcMenuSurface.getDefaultFoundation().close()
    })
  },