Skip to content

Commit

Permalink
Fix bug in README.md
Browse files Browse the repository at this point in the history
Per https://vuejs.org/guide/essentials/template-refs.html#accessing-the-refs, "you can only access the ref after the component is mounted". Therefore `this.createTour()` which uses `this.$ref.el` should be called in `mounted()` instead of `created()`
  • Loading branch information
lcb931023 committed May 1, 2023
1 parent d9c1a36 commit d2e731d
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -91,11 +91,8 @@ createApp().use(VueShepherdPlugin).mount('#app');
}
},
created(){
this.createTour();
},
mounted(){
this.createTour();
this.tour.start();
}
});
Expand Down

0 comments on commit d2e731d

Please sign in to comment.