1.0.0 • Published 1 year ago

tavern-waterfall-layout v1.0.0

Weekly downloads
-
License
ISC
Repository
-
Last release
1 year ago

使用方法

  1. 安装npm install tavern-waterfall-layout --save

  1. 使用 在vue
<template>
  <div class="list">
    <div class="waterfall" id="waterfall">
      <div class="wapper-item" v-for="item in 6" :key="item" >{{ item }}</div>
    </div>
  </div>
</template>
<script setup lang="ts">
import wLayout from 'tavern-waterfall-layout'
import { onMounted } from 'vue'

onMounted(() => {
  const waterfall = document.getElementById('waterfall')
  let wlayout = new wLayout(waterfall, { gap: 20 })
  wlayout.init()
})

</script>

<style lang="scss" scoped>
  .wapper {
    position: relative;
    width: 100vh;
    &-item {
      width: 300px;
      height: 100px;
      margin-bottom: 20px;
    }
  }
</style>

Attributes

参数说明类型可选值默认
DOM参数1Document
options参数2,gap: 间距ObjectGap0