分类目录: html5
vue3+ts引入AntDesign Vue,按需引用
Post date:
Author: cyy
标签: AntDesign Vue, vue3
Number of comments: no comments
1.安装antd vue
cnpm install ant-design-vue --save-dev
2.在代码中,需要的地方按需引用
<template>
<div class="my-table" ref="tContainer">
<a-table style="height: 100%;"
:dataSource="dataSource"
:columns="columns"
emptyText=""
:pagination="false"
:row-class-name="(_record, index) => (index % 2 === 1 ? null : 'table-striped')" >
<template #emptyText></template>
</a-table>
</div>
</template>
import {Table} from "ant-design-vue";
export default {
name: "MyTable",
components: {
"a-table": Table, // 表格
},
props: {
},
setup(props) {
const tContainer = ref(null)
// 表格数据
const dataSource = computed(() => {
return []
})
// 列头数据
const columns = computed(() => {
return []
})
onMounted(() => {
})
return {
}
}
}