I have a file app.js with the following vue object:
var app = new Vue({
el: '#app',
data: {
test: ''
}
});
I also have a separate js file which is loaded after the app.js file.
When the js file contains the following code, the object will update and show on the page.
app.test = 'test'
$(document).ready(function() {
}
However if I move the first line into the document ready callback function then the element doesn't update on the page:
$(document).ready(function() {
app.test = 'test'
}
I am not quite sure why this is happening... Would someone be able to explain this to me? And potentially let me know of a way so that I can update the element in the document ready callback function.
Thank you.
document.ready, could you use themountedevent in Vue?