feat: move from life cycle to data or watcher
- remove from created / mounted - initialize component services in data - use immediate watcher where appropriate - deep watch for route changes
This commit is contained in:
parent
ebeca48be4
commit
f51371bbe0
59 changed files with 246 additions and 376 deletions
|
|
@ -26,8 +26,8 @@ export default {
|
|||
name: 'listSearch',
|
||||
data() {
|
||||
return {
|
||||
listSerivce: ListService,
|
||||
list: ListModel,
|
||||
listSerivce: new ListService(),
|
||||
list: new ListModel(),
|
||||
foundLists: [],
|
||||
}
|
||||
},
|
||||
|
|
@ -39,18 +39,14 @@ export default {
|
|||
components: {
|
||||
Multiselect,
|
||||
},
|
||||
beforeMount() {
|
||||
this.listSerivce = new ListService()
|
||||
this.list = new ListModel()
|
||||
},
|
||||
watch: {
|
||||
value(newVal) {
|
||||
this.list = newVal
|
||||
value: {
|
||||
handler(value) {
|
||||
this.list = value
|
||||
},
|
||||
immeditate: true,
|
||||
},
|
||||
},
|
||||
mounted() {
|
||||
this.list = this.value
|
||||
},
|
||||
methods: {
|
||||
findLists(query) {
|
||||
if (query === '') {
|
||||
|
|
|
|||
Reference in a new issue