I'm trying to use the vue-paginate component from https://www.npmjs.com/package/vue-paginate .
I want to create pagination for the questions I load from firebase. The declaration is here:
new Vue({
el: '#app',
data: {
quiz: {
questions: [],
answers: [],
title: ''
},
paginate: ['questions']
}
Questions are in this form:
questions" : [ {
"q_options" : [ "Yes", "No", "Don't know" ],
"q_text" : "My organisation blah blah",
...
},{
"q_options" : [ "Yes", "Maybe", "Don't know" ],
"q_text" : " blah blah",
...
}]
And I'm calling it like this in the template:
<paginate name="quiz" :list="quiz" :per="2">
<li v-for="(quest,index) in paginated('quiz.questions')">
{{ quest.q_text }}
</li>
</paginate>
So, I'm getting the following errors: [vue-paginate]: 'quiz.questions' is not registered in 'paginate' array. (found in root instance) vue-paginate.js:21:6 [Vue warn]: Invalid prop: type check failed for prop "list". Expected Array, got Object. (found in component )
How should I add/register the quiz.questions in the paginate('') array?
Thank you