How to use the @material/grid-list/foundation function in @material/grid-list

To help you get started, we’ve selected a few @material/grid-list 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-grid-list / grid-list.js View on Github external
mounted() {
    this.foundation = new MDCGridListFoundation({
      getOffsetWidth: () => {
        return this.$el.offsetWidth;
      },
      getNumberOfTiles: () => {
        return this.$el.querySelectorAll(
          MDCGridListFoundation.strings.TILE_SELECTOR,
        ).length;
      },
      getOffsetWidthForTileAtIndex: index => {
        return this.$el.querySelectorAll(
          MDCGridListFoundation.strings.TILE_SELECTOR,
        )[index].offsetWidth;
      },
      setStyleForTilesElement: (property, value) => {
        this.$el.querySelector(
          MDCGridListFoundation.strings.TILES_SELECTOR,