1👍
✅
All properties of the app are accessible from the object returned by createApp
, you just need to assign it.
import { createApp } from "vue";
const app = createApp({
data() {
return {
key: "VueJS is working now",
question: "answer",
main_attributes: {}
};
},
created() {
this.key = "sdfgsdfgsdfgsdfg";
}
}).mount("#project");
console.log(app.key); // logs 'sdfgsdfgsdfgsdfg'
Source:stackexchange.com