B
B
beduin012016-02-16 16:02:47
Vue.js
beduin01, 2016-02-16 16:02:47

How to display data in template in Vue.js component?

This is what my component looks like:

var guestContent = Vue.extend({
      template: `

        <p>Guest content</p>

          `,
        data: function () {
          return
          {
            qs: getQuestionsContent();  // я правильно получаю в него данные из функции?          
           }
            
          }

        }
        );


My App.js:

App = new Vue ({ /
   el: '#app',
  data: 
    {
      topMenuView: "guestmenu",
      contentView: "guestcontent",
    }
  })



I want to display the content of `qs` in the component template instead of `Guest content` and for example iterate over it with `v-for`. Question. How can I access this data? Whether correctly to receive the data in a component with which I work? Or should it be in the main Vue instance?

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question