Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

180
Views
Why can't I access $data on Vue 3 instance?

I've got a strange problem: I'm unable to access data() from a vue instance:

const vueapp = Vue.createApp({
  data(){
    return {
      form:{ .... }
[etc..]

// later:

console.log(vueapp.$data, vueapp.form) // both undefined

Why?

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

https://v3.vuejs.org/guide/instance.html#creating-an-application-instance

The app and its root component are subtly but importantly different. The options you pass to createApp don't exist on the app, but its root component.

The options passed to createApp are used to configure the root component. That component is used as the starting point for rendering when we mount the application.

const app = Vue.createApp(RootComponent)
const vm = app.mount('#app')

You can do vm.$data and vm.form in the above code sample, but not app.$data or app.form.

about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!