onlycode.org

javascript
jquery
html
angularjs
css
node.js
ajax
html5
php
json
arrays
google-chrome
dom
regex
reactjs
ecmascript-6
javascript-events

your's history:
how to display content b...

How to display content by page number or prev next clicked on the vue, just only code?

vuejs2 | pagination | vue.js | javascript | vue-component

edit
data () {
          return{
              container:{ 
              // for Vue.set I didnt found how to do it without nested fields for data object, so did like that on my own project
                  items: '',
                  itemsPagination: ''
              }
          }
        },
Vue.set(this.container, 'items', r.data); 
// or this.$set, if you dont use arrow function here, and not Vue accessable

27
SiarheiK, 17.09.2018 11:47




edit
    data () {
      return{
          items: '',
          itemsPagination: ''
      }
    }
    data () {
      return{
          items: '',
          itemsPagination: {
            current_page: 1
          }
      }
    }
<template>
  <div>
    <h6>Default</h6>
    <b-pagination size="md" :total-rows="100" v-model="itemsPagination.current_page" :per-page="10">
    </b-pagination>
    <br>

    <h6>Small</h6>
    <b-pagination size="sm" :total-rows="100" v-model="itemsPagination.current_page" :per-page="10">
    </b-pagination>
    <br>

    <h6>Large</h6>
    <b-pagination size="lg" :total-rows="100" v-model="itemsPagination.current_page" :per-page="10">
    </b-pagination>
    <br>

    <div>currentPage: {{itemsPagination.current_page}}</div>
  </div>    
</template>

<script>
export default {
  data () {
    return {
      itemsPagination: {
        current_page: 1
      }
    }
  }
}
</script>

<!-- pagination-1.vue -->

25
Roy J, 17.09.2018 23:29

Add your just only code

your name:    



If you need full text click here

Some similar links How to display content by page number or prev next clicked on the vue? ↓:
Vue display unescaped html

How to display button link with vue.js?

When a user clicks Show link, display the password, hide it when clicked again

How to update data on a page without refreshing on the vue.js?



This project is created for those who just need only code, wihout maaaaaaaaaaany words.