docs: improve docs and update api

This commit is contained in:
Justineo
2021-11-24 12:05:27 +08:00
parent a790f0d8a9
commit 5226ec968c
19 changed files with 297 additions and 114 deletions

View File

@@ -1,34 +1,36 @@
<template>
<article>
<section>
<div>loading<veui-switch v-model="loading"/></div>
<veui-table
:data="data"
:loading="loading"
key-field="id"
>
<veui-table-column
field="id"
title="ID"
sortable
/>
<veui-table-column
field="name"
title="Name"
/>
<veui-table-column
field="bid"
title="Bid"
width="160"
align="right"
sortable
>
<template slot-scope="{ bid }">
{{ bid | currency }}
</template>
</veui-table-column>
</veui-table>
<veui-switch v-model="loading">
Loading
</veui-switch>
</section>
<veui-table
:data="data"
:loading="loading"
key-field="id"
>
<veui-table-column
field="id"
title="ID"
sortable
/>
<veui-table-column
field="name"
title="Name"
/>
<veui-table-column
field="bid"
title="Bid"
width="160"
align="right"
sortable
>
<template slot-scope="{ bid }">
{{ bid | currency }}
</template>
</veui-table-column>
</veui-table>
</article>
</template>

View File

@@ -0,0 +1,64 @@
<template>
<article>
<veui-table
:data="data"
key-field="id"
>
<veui-table-column
field="id"
title="ID"
/>
<veui-table-column
field="name"
title="Name"
/>
<veui-table-column
field="desc"
title="Description"
tooltip
/>
</veui-table>
</article>
</template>
<script>
import { Table, Column } from 'veui'
const long = 'Lorem ipsum dolor sit amet, consectetur adipisicing elit. Quos, quibusdam! Pariatur, laboriosam? Voluptatibus, sunt.'
const short = 'Lorem ipsum.'
export default {
components: {
'veui-table': Table,
'veui-table-column': Column
},
data () {
return {
density: 'normal',
size: 'm',
data: [
{
id: '3154',
name: 'Steve Rogers',
desc: long
},
{
id: '3155',
name: 'Thor Odinson',
desc: short
},
{
id: '3156',
name: 'Tony Stark',
desc: short
},
{
id: '3157',
name: 'Stephen Strange',
desc: long
}
]
}
}
}
</script>