最近开发中遇到了avue前端框架

发现与我们平常的vue写法大有不同,封装过多的函数用法,前所未有的格式,一系列的食用技巧.

子表单(单列多数据)食用

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
{
label: '子表单',
prop: 'dynamic',
type: 'dynamic',
span: 24,
children: {
align: 'center',
headerAlign: 'center',
rowAdd: (done) => {
this.$message.success('新增回调');
done({
input: '默认值'
});
},
rowDel: (row, done) => {
this.$message.success('删除回调' + JSON.stringify(row));
done();
},
column: [{
// width: 800,
span: 24,
label: '题目选项',
prop: "input",
// formslot: true,
}]
}

动态列

可以通过给 列的List添加其他需要的字段

调用内部的增删改查方法

添加

1
this.$refs.crud.rowAdd()

删除

1
$refs.crud.rowDel(row,index)

自定义rule表达

定义一个方法 定义表达式验证

在方法里判断

去掉标题 冒号

使用elmeent确认框 需注意 .then方法是同级的,可能会出现先清除了数据才调用.then的方法