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
},
},
......
......@@ -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
......
......@@ -19,6 +19,7 @@
: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