Commit e49206c3 authored by 刘子康's avatar 刘子康

更新支持slot,暂不支持穿梭框;增加测试案例

parent f352f3c3
......@@ -505,7 +505,7 @@ export default {
...this.generatorDefaultEvents(item),
...item.componentsEvents
},
}
}, item.slot ? [this.$slots.default, item.slot(h)] : this.$slots.default
)
},
/**
......@@ -812,9 +812,11 @@ export default {
.ivu-cascader {
line-height: inherit;
}
.ivu-input-number {
width: 100% !important;
}
// 项目下的fix样式
// .ivu-input-number-input-wrap {
// height: 25px !important;
......@@ -889,17 +891,20 @@ export default {
display: none !important;
}
}
.ivu-form-label-top{
.ivu-form-item-label{
text-align: left!important;
.ivu-form-label-top {
.ivu-form-item-label {
text-align: left !important;
}
.ivu-form-item-content{
margin-left: 0!important;
.ivu-form-item-content {
margin-left: 0 !important;
}
}
.ivu-form-label-right{
.ivu-form-item-label{
text-align: right!important;
.ivu-form-label-right {
.ivu-form-item-label {
text-align: right !important;
}
}
......
......@@ -46,8 +46,7 @@
<script>
import LabelItem from './label-item.vue'
let data1 = []
let targetKeys1 = []
export default {
name: 'page-Form',
components: {
......@@ -315,19 +314,57 @@ export default {
},
},
{
name: 'Transfer',
name: 'Rate',
required: true,
type: 'Transfer',
key: 'Transfer',
type: 'Rate',
key: 'Rate'
},
{
name: 'Upload',
type: 'Upload',
key: 'Upload',
componentsProps: {
data: data1,
renderFormat: this.render1,
targetKeys: targetKeys1
data: {},
action: 'https://jsonplaceholder.typicode.com/posts/',
'list-type': 'picture-card',
'on-success': (res, file, fileList) => {
console.log(res, file, fileList)
},
'on-preview': (file) => {
console.log(file)
},
'on-remove': (file, fileList) => {
console.log(file, fileList)
},
'on-progress': (e, file, fileList) => {
console.log(e, file, fileList)
},
'on-change': (file, fileList) => {
console.log(file, fileList)
},
componentEvents: {
'on-change': this.handleChange1
'on-error': (file, fileList) => {
console.log(file, fileList)
},
},
slot: (h) => {
return h('Button', {
icon: 'ios-cloud-upload-outline'
}, '点击上传')
}
},
{
name: 'ColorPicker',
required: true,
type: 'ColorPicker',
key: 'ColorPicker'
},
{
name: 'Slider',
required: true,
type: 'Slider',
key: 'Slider',
requiredType: 'number'
},
],
actionProps: {
submit: {
......@@ -345,16 +382,14 @@ export default {
text: '重置'
},
},
// 测试数据
data1: this.getMockData(),
targetKeys1: this.getTargetKeys()
};
},
beforeMount() {
console.log(this.getTargetKeys())
},
created() {
console.log()
},
mounted() {
......@@ -385,32 +420,8 @@ export default {
},
]
},
getMockData() {
let mockData = [];
for (let i = 1; i <= 20; i++) {
mockData.push({
key: i.toString(),
label: 'Content ' + i,
description: 'The desc of content ' + i,
disabled: Math.random() * 3 < 1
});
}
return mockData;
},
getTargetKeys() {
return this.getMockData()
.filter(() => Math.random() * 2 > 1)
.map(item => item.key);
},
render1(item) {
return item.label;
},
handleChange1(newTargetKeys, direction, moveKeys) {
console.log(newTargetKeys);
console.log(direction);
console.log(moveKeys);
this.targetKeys1 = newTargetKeys;
}
},
watch: {
......
......@@ -67,10 +67,7 @@ export default {
},
originData: [
{
type: 'Title',
name: '查询条件',
},
{
type: 'Row',
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment