# 普通用法
点击查看代码
<template>
<div>
<ygp-crud :dic="dic" :data="data" :option="option"></ygp-crud>
</div>
</template>
export default {
data() {
return {
dic: {
dicData: [
{
label: "男",
value: 0,
},
{
label: "女",
value: 1,
},
],
},
data: [
{
name: "张三",
sex: 0,
date: "1994-02-23 00:00:00",
},
{
name: "李四",
sex: 1,
date: "1994-02-23 00:00:00",
},
{
name: "王五",
sex: 1,
date: "1994-02-23 00:00:00",
},
{
name: "赵六",
sex: 0,
date: "1994-02-23 00:00:00",
},
],
option: {
columns: [
{
label: "姓名",
prop: "name",
edit: true,
},
{
label: "性别",
prop: "sex",
edit: true,
type: "select",
dicName: "dicData",
options: [],
labelKey: "label",
valueKey: "value",
},
{
label: "日期",
prop: "date",
edit: true,
type: "date",
},
],
},
};
},
};