I am using this approach now but just to note the component did not work for me I had to wrap an extra div tag around the button and modal as the Vue component can only have a single child node inside the template tag.
Thanks, yes you are correct about single child node in templates BUT this single child is for vue 2, in new version of vue we have fragments by default and you can write multiple child nodes in templates.
Some comments have been hidden by the post's author - find out more
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
Hello thanks for this post.
I am using this approach now but just to note the component did not work for me I had to wrap an extra div tag around the button and modal as the Vue component can only have a single child node inside the template tag.
You may want to update accordingly
Thanks, yes you are correct about single child node in templates BUT this single child is for vue 2, in new version of vue we have fragments by default and you can write multiple child nodes in templates.