How to use the @material/tab-bar/foundation function in @material/tab-bar

To help you get started, we’ve selected a few @material/tab-bar 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 pgbross / vue-material-adapter / packages / mcwv-tabs / tab-bar.js View on Github external
mounted() {
    this.foundation = new MDCTabBarFoundation({
      scrollTo: scrollX => this.$refs.scroller.scrollTo(scrollX),
      incrementScroll: scrollXIncrement =>
        this.$refs.scroller.incrementScroll(scrollXIncrement),
      getScrollPosition: () => this.$refs.scroller.getScrollPosition(),
      getScrollContentWidth: () => this.$refs.scroller.getScrollContentWidth(),
      getOffsetWidth: () => this.$el.offsetWidth,
      isRTL: () =>
        window.getComputedStyle(this.$el).getPropertyValue('direction') ===
        'rtl',
      setActiveTab: index => {
        this.foundation.activateTab(index);
      },
      activateTabAtIndex: (index, clientRect) => {
        this.tabList[index].activate(clientRect);
      },
      deactivateTabAtIndex: index => {