Commit 243c82f3 authored by 廖伟胜's avatar 廖伟胜

修改子父组件循环调用问题

parent e6973442
......@@ -85,14 +85,16 @@ export default{
dialog_visible: false,
qiniuToken: '',
list: [], // 文件列表
data:[],
index: '',
}
},
watch: {
value(value) {
this.list = this.init().data(value)
this.list = this.init().data(value);
this.data = this.list;
},
list(value) {
data(value) {
const data = this.init().value(value)
this.$emit('input', data)
},
......@@ -100,7 +102,6 @@ export default{
computed: {
computedDataType() {
const { dataType, limit } = this
console.log('limit', limit)
return limit === 1 ? 'string' : dataType
},
},
......@@ -113,7 +114,7 @@ export default{
// 初始化返回数据
value: (list) => {
let value = ''
const { computedDataType: dataType } = this
const { computedDataType: dataType } = this
switch(dataType) {
case 'string': // 字符串类型以逗号隔开
value = list.join(',')
......
......@@ -8,6 +8,7 @@
<i v-else :style="style" class="avatar el-icon-plus avatar-uploader-icon">
<span class="upload-label">{{ label }}</span>
</i>
</el-upload>
<span class="upload-tips">{{ tips }}</span>
</div>
......@@ -95,6 +96,8 @@ export default{
},
src() {
const { data, imgDomain } = this
console.log(data);
const reg = /^([hH][tT]{2}[pP]:\/\/|[hH][tT]{2}[pP][sS]:\/\/)(([A-Za-z0-9-~]+)\.)+([A-Za-z0-9-~\/])+$/
if (reg.test(data)) {
return data
......
......@@ -15,10 +15,11 @@
:size="size"
/>
<UploadFile v-if="type === 'file'"
:label="label"
:label="label"
:limit="limit"
v-model="value"
:edit="edit"
:data-type="dataType"
:dialog="dialog"
:tips="tips"
:source="source"
......
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