Commit a7531908 authored by guangxing.xu's avatar guangxing.xu

feat: 增加swiper选择器

parent f13a8b6d
<template>
<div class="swiperListSelector">
<div class="listItem" v-for="(item, index) in lists" :key="index">
<p>素材{{index + 1}}</p>
<Form @submit.native.prevent ref="formCustom" :model="item" :label-width="90" label-position="left">
<FormItem label="素材名称" prop="name">
<Input v-model="item.name" placeholder="请输入素材名称" />
</FormItem>
<FormItem label="轮播图" prop="img">
<Upload v-model="item.img" />
</FormItem>
<FormItem label="跳转链接" prop="link">
<Input v-model="item.link" placeholder="请输入跳转链接" />
</FormItem>
</Form>
<Button type="error" @click="del(index)" class="delete">删除</Button>
</div>
<Button type="dashed" icon="plus-round" @click="add">添加素材</Button>
<!-- <Button type="primary" @click="save">保存</Button> -->
</div>
</template>
<script>
import ColorSelector from '@editor/component/DynamicForm/component/ColorSelector/index.vue';
import Upload from '@editor/component/DynamicForm/component/Upload/index.vue';
export default {
props: {
value: {
type: Array,
default: () => []
}
},
components: {
Upload,
ColorSelector
},
data() {
return {
lists: [],
}
},
watch: {
value(val) {
this.lists = val;
},
goods: {
handler(val) {
this.$emit('input', val);
},
deep: true
}
},
created() {
this.lists = JSON.parse(JSON.stringify(this.value));
},
methods: {
add() {
this.lists.push({
name: '',
img: '',
link: ''
})
},
del(index) {
this.lists.splice(index, 1)
}
}
}
</script>
<style scoped lang="less">
.swiperListSelector{
.listItem{
border: 1px solid #dddee1;
border-radius: 4px;
margin-bottom: 10px;
padding: 5px;
.delete{
width: 100%;
margin-top: 10px;
}
/deep/ .ivu-form-item{
margin-bottom: 10px;
}
}
}
</style>
...@@ -11,7 +11,8 @@ import VerticalAdStyleSelector from './component/VerticalAdStyleSelector/index.v ...@@ -11,7 +11,8 @@ import VerticalAdStyleSelector from './component/VerticalAdStyleSelector/index.v
import CategoryTypeSelector from './component/CategoryTypeSelector/index.vue'; import CategoryTypeSelector from './component/CategoryTypeSelector/index.vue';
import CategorySelector from './component/CategorySelector/index.vue'; import CategorySelector from './component/CategorySelector/index.vue';
import BatchGoodsSelector from './component/BatchGoodsSelector/index.vue'; import BatchGoodsSelector from './component/BatchGoodsSelector/index.vue';
import GoodsSwiperStyleTypeSelector from './component/GoodsSwiperStyleTypeSelector/index.vue'; import SwiperStyleTypeSelector from './component/SwiperStyleTypeSelector/index.vue';
import SwiperListSelector from './component/SwiperListSelector/index.vue';
import GoodsSwiperSelector from './component/GoodsSwiperSelector/index.vue'; import GoodsSwiperSelector from './component/GoodsSwiperSelector/index.vue';
import DiscountGoodsSelectorV2 from './component/DiscountGoodsSelectorV2/index.vue'; import DiscountGoodsSelectorV2 from './component/DiscountGoodsSelectorV2/index.vue';
import BaseSelect from './component/BaseSelect/index.vue'; import BaseSelect from './component/BaseSelect/index.vue';
...@@ -45,7 +46,8 @@ const allComponentsMap = getAllScheme(); ...@@ -45,7 +46,8 @@ const allComponentsMap = getAllScheme();
VerticalAdStyleSelector, VerticalAdStyleSelector,
BatchGoodsSelector, BatchGoodsSelector,
DiscountGoodsSelectorV2, DiscountGoodsSelectorV2,
GoodsSwiperStyleTypeSelector, SwiperStyleTypeSelector,
SwiperListSelector,
GoodsSwiperSelector GoodsSwiperSelector
}, name: 'DynamicForm' }) }, name: 'DynamicForm' })
export default class DynamicForm extends Mixins(ContextMenuMixin, DynamicFormMixin) { export default class DynamicForm extends Mixins(ContextMenuMixin, DynamicFormMixin) {
......
...@@ -2176,9 +2176,9 @@ ...@@ -2176,9 +2176,9 @@
} }
}, },
"@qg/citrus-ui": { "@qg/citrus-ui": {
"version": "0.3.44-beta1", "version": "0.3.44-beta3",
"resolved": "http://npmprivate.quantgroups.com/@qg%2fcitrus-ui/-/citrus-ui-0.3.44-beta1.tgz", "resolved": "http://npmprivate.quantgroups.com/@qg%2fcitrus-ui/-/citrus-ui-0.3.44-beta3.tgz",
"integrity": "sha512-NCqG4zfGSlAbvkiHQxhraHtHFkVOrSkSc+Z33nHKATn7mTruVTfqxgEwx5ayl2TMqlr2oxO/bNKjX/HGupHVUA==", "integrity": "sha512-Vhuaxj8mmDlEYxcjLQXa7wMEKzkYcwVMr3lv8JEMDi3/nlchZ6eyWI355qjSM0dTFtAhAnILV2txDfAS1LMtcA==",
"requires": { "requires": {
"@better-scroll/core": "^2.1.1", "@better-scroll/core": "^2.1.1",
"@qg/cherry-ui": "^2.23.9", "@qg/cherry-ui": "^2.23.9",
......
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