diff --git a/.changeset/smooth-kids-reflect.md b/.changeset/smooth-kids-reflect.md new file mode 100644 index 000000000..9b6699373 --- /dev/null +++ b/.changeset/smooth-kids-reflect.md @@ -0,0 +1,5 @@ +--- +"druxt-views": patch +--- + +Fixed undefined errors in DruxtView watch methods. diff --git a/packages/views/src/components/DruxtView.vue b/packages/views/src/components/DruxtView.vue index eeecd4381..c6eadd1e3 100644 --- a/packages/views/src/components/DruxtView.vue +++ b/packages/views/src/components/DruxtView.vue @@ -281,7 +281,7 @@ export default { watch: { async '$route.query'(to) { - if (!Object.entries(to).length) { + if (!Object.entries(to || {}).length) { this.model = { filter: {}, page: null, @@ -297,7 +297,7 @@ export default { 'model.filter': { deep: true, async handler(to, from) { - if (!Object.entries(to).length && !Object.entries(from).length) { + if (!Object.entries(to || {}).length && !Object.entries(from || {}).length) { return } await this.$fetch()