B
B
beduin012016-02-17 10:59:52
Vue.js
beduin01, 2016-02-17 10:59:52

Understand the basics of Vue.JS?

I'm learning JS and Vue.JS and I've come across the fact that I don't understand the basics of Vue and reading the documentation does not clarify them.
vuejs.org/api/#data
With the creation of the Vue object, everything seems to be clear. However, what does `data` mean?

As I understand it, you can call an extended constructor called Vue.extend. You can create a component in it. But why is it necessary to return when it is called from a component?
"When defining a component, data must be declared as a function that returns the initial data object, because there will be many instances created using the same definition".

If I do a basic version that is not a return component, then what will happen?

What does `methods` mean? What should I put in there? Can I call functions in `data`?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexander Alekseev, 2016-10-11
@shure348

data is a model, an object where all application data will be
methods - data processing functions, application logic,
roughly speaking, functions from methods process the data model and blocks subscribed to data from the model dynamically change in templates

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question