D
D
DiseaseC2019-07-03 11:48:00
Vue.js
DiseaseC, 2019-07-03 11:48:00

How to transfer data from Vue component to main file?

There is an array of data that is turned into a list by the v-for directive.

<li> v-for="item in items" </li>


data: function () {
            return {
                items: [
                     ...
                ]

How to make it so that data can be added to the array through a new function, and the array itself becomes global? (Now it's inside a list component)

Answer the question

In order to leave comments, you need to log in

1 answer(s)
E
Evgeny Kulakov, 2019-07-03
@kulakoff Vue.js

Options:
1. pass through props
2. request from some data source in create/mount hooks

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question