Skip to content
This repository has been archived by the owner on Sep 22, 2024. It is now read-only.

Commit

Permalink
fields: input-select-search & input-file, fix reactive
Browse files Browse the repository at this point in the history
  • Loading branch information
mtmsig committed Aug 9, 2019
1 parent 86d2132 commit f1e0584
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 9 deletions.
17 changes: 11 additions & 6 deletions src/components/fields/input-file.vue
Original file line number Diff line number Diff line change
Expand Up @@ -80,12 +80,17 @@ export default {
}
},
created() {
if (this.url) {
this.fileList.push({
url: this.url,
name: this.url.split("/").slice(-1)[0]
});
watch: {
url: {
immediate: true,
handler(url) {
if (url) {
this.fileList.push({
url: url,
name: url.split("/").slice(-1)[0]
});
}
}
}
}
};
Expand Down
11 changes: 8 additions & 3 deletions src/components/fields/input-select-search.vue
Original file line number Diff line number Diff line change
Expand Up @@ -120,9 +120,14 @@ export default {
});
}
},
created() {
if (this.value) {
this.getSelectedItem();
watch: {
value: {
immediate: true,
handler(value) {
if (value && !this.selectedItem) {
this.getSelectedItem();
}
}
}
}
};
Expand Down

0 comments on commit f1e0584

Please sign in to comment.