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,
props: ['boardUsername'],
watch: {
boardUsername() {
this.reset();
},
},
methods: {
initialize() {
this.fetchMore(true);

View File

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