Fix: Fix component not update error on board-url changing

This commit is contained in:
winkidney
2019-12-07 19:32:28 +08:00
committed by Isaac Bythewood
parent ba21df6914
commit 83e85e9e7b
2 changed files with 7 additions and 2 deletions

View File

@@ -118,6 +118,11 @@ export default {
}, },
data: initialData, data: initialData,
props: ['boardUsername'], props: ['boardUsername'],
watch: {
boardUsername() {
this.reset();
},
},
methods: { methods: {
initialize() { initialize() {
this.fetchMore(true); this.fetchMore(true);

View File

@@ -13,7 +13,7 @@ export default {
name: 'Boards4User', name: 'Boards4User',
data() { data() {
return { return {
username: null, username: '',
}; };
}, },
components: { components: {
@@ -24,7 +24,7 @@ export default {
this.initialize(); this.initialize();
}, },
beforeRouteUpdate(to, from, next) { beforeRouteUpdate(to, from, next) {
this.initialize(); this.username = to.params.username;
next(); next();
}, },
methods: { methods: {