1

Are Vue's Single file components for e.g App, QuotesList, QuoteItem (each an SFC) nested objects when compiled, for example:

Diagrammatic Representation

App(Parent)
 |
  QuotesList (child of App)
         | 
          QuoteItem (child of QuotesList)

JS Object representation

var App = {
    quotesList : {
        quoteItem: {..}
    }
}

1 Answer 1

1

not exactly. actually each vue component is an object containing the vue properties plus properties that you have defined (data properties, life cycle hooks, watchers, etc).

but there is still a way to get information about the components relationship:

the vue component object has references to its children component, which you can access via this.$children, and has a reference to its parent component, available via this.$parent.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.