3
I have the variable Vue:
var appExemplo = new Vue({
el: "#appExemplo"
});
How can I take the value that’s in el? That in this example would be #appExemplo.
This.el return undefined.
3
I have the variable Vue:
var appExemplo = new Vue({
el: "#appExemplo"
});
How can I take the value that’s in el? That in this example would be #appExemplo.
This.el return undefined.
5
you want to get the DOM manipulated by vue?
you can use the property $el
var appExemplo = new Vue({
el: "#appExemplo",
data: {
message: 'Hello World!'
}
});
console.log(appExemplo.$el.id, appExemplo.$el);
<script src="https://cdnjs.cloudflare.com/ajax/libs/vue/2.4.2/vue.min.js"></script>
<div id="appExemplo">
{{ message }}
</div>
Browser other questions tagged vue.js
You are not signed in. Login or sign up in order to post.