An open API service indexing awesome lists of open source software.

https://github.com/qiu-jun/vue3-justified-layout


https://github.com/qiu-jun/vue3-justified-layout

Last synced: about 2 months ago
JSON representation

Awesome Lists containing this project

README

        

## vue3-justified-layout

#### Usage

```bash
pnpm add vue3-justified-layout
# or
# yarn install vue3-justified-layout
# npm install vue3-justified-layout
```

```html







添加

import { ref } from 'vue'
import Vue3JustifiedLayout from 'vue3-justified-layout'
import 'vue3-justified-layout/dist/style.css'
import type { IJLItem } from '@/components/JustifiedLayout'

import img1 from '@/assets/1.jpeg'
import img2 from '@/assets/2.jpeg'
import img3 from '@/assets/3.jpeg'
import img4 from '@/assets/4.jpeg'

const options = {
targetRowHeight: 120 // 高度
}

const test: IJLItem[] = [
{
url: img1,
width: 800,
height: 572
},
{
url: img2,
width: 6000,
height: 4000
},
{
url: img3,
width: 800,
height: 533
},
{
url: img4,
width: 1000,
height: 1418
}
]

const list = ref([...test])

const handleAdd = () => {
list.value.push(test[Math.floor(Math.random() * 4)])
}

```