Vue Js 2 More Instances

Posted on  by admin

Modified4 years, 3 months ago. I'm trying to add two Vue.js instance to the same .js file as follows :.

I call these two instances in two separate web pages. But I'm getting a Vue warning such as [Vue warn]: Cannot find element: #step1 not found or [Vue warn]: Cannot find element: #step2 not found.

Am I doing it wrong? or is there any way that I can concatenate the two instances together?

99 gold badges6060 silver badges102102 bronze badges.

102102 bronze badges. If you must design your code this way, you could test if the element is on that page first before instantiating the Vue instance:.

33 gold badges2727 silver badges3636 bronze badges. 3636 bronze badges. You’re browsing the documentation for v2.x and earlier. For v3.x, click here. Every Vue application starts by creating a new Vue instance with the Vue function:.