Skip to content

Commit

Permalink
handle central slot existence better
Browse files Browse the repository at this point in the history
  • Loading branch information
RichardW committed Jan 12, 2020
1 parent 97d548f commit 2015e77
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/components/nav-wheel.vue
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,13 @@ export default {
},
mounted() {
// Reposition the slot to be inline with the radial wheel.
this.centerSlotBox = this.$slots.center[0].elm.getBBox();
if (this.$slots.center) {
if (this.$slots.center.length > 1)
throw new Error(
"Expecting only one element, please wrap in a <g> tag."
);
this.centerSlotBox = this.$slots.center[0].elm.getBBox();
}
},
watch: {
$route() {
Expand Down

0 comments on commit 2015e77

Please sign in to comment.