I have a simple vue instance:
var vm = new Vue({
el: "#myEl",
data: {
parent: null,
posts: [],
total: 0,
currentPage: 0
},
mounted: function () {
alert("mounted");
}
});
Evething is fine, when #myEl is exist on the page, but if it not, mounter hook fires anyway.
But why? There is no element to mount instance for, so why it mounted anyway?
What should I do in vue-way to check the el existence?