分享描述添加多个

This commit is contained in:
老叶
2022-09-23 16:21:58 +08:00
parent 8a3833a914
commit 82ac5e2135
2 changed files with 35 additions and 8 deletions
+1 -1
View File
@@ -10,7 +10,7 @@ export default {
website: '官网',
document: '文档',
authorization: '授权',
copyright: 'Copyright © 2022 厦门狸车科技有限公司'
copyright: 'Copyright © 2022 狸车(厦门)网络科技有限公司'
},
logout: {
title: '提示',
@@ -74,12 +74,27 @@
/>
</el-form-item>
<el-form-item label="分享描述:" prop="shareTitle">
<el-input
clearable
:maxlength="60"
v-model="form.shareTitle"
placeholder="请输入分享描述"
/>
<div
style="margin: 8px 0"
v-for="(item, index) in form.shareTitle"
:key="index"
>
<el-input
clearable
:maxlength="60"
v-model="form.shareTitle[index]"
placeholder="请输入分享描述"
/>
</div>
<el-button
type="primary"
plain
size="small"
icon="el-icon-plus"
@click="addShareTitle"
>
新增分享描述
</el-button>
</el-form-item>
</el-form>
<template v-slot:footer>
@@ -114,7 +129,7 @@
channelId: '',
dateRange: '',
introduction: '',
shareTitle: '',
shareTitle: [''],
shareImg: [],
bgImg: []
};
@@ -180,12 +195,21 @@
}
},
methods: {
/* 添加分享描述 */
addShareTitle() {
this.form.shareTitle.push('');
},
/* 保存编辑 */
save() {
this.$refs.form.validate((valid) => {
if (!valid) {
return false;
}
this.form.shareTitle.forEach((item, i) => {
if (item == '') {
this.form.shareTitle.splice(i, 1);
}
});
this.loading = true;
const data = {
...this.form
@@ -287,6 +311,9 @@
...this.data
});
this.isUpdate = true;
if (this.form.shareTitle.length == 0) {
this.form.shareTitle.push('');
}
} else {
this.form.organizationId = this.organizationId;
this.form.bgImg = [];