1

I'm trying to use Bootstrap-vue pagination component but it's not working. I went to the documentation and just tried to use their example:

<template>
  <div class="overflow-auto">
    <b-pagination
      v-model="currentPage"
      :total-rows="rows"
      :per-page="perPage"
      aria-controls="my-table"
    ></b-pagination>

    <p class="mt-3">Current Page: {{ currentPage }}</p>

    <b-table
      id="my-table"
      :items="items"
      :per-page="perPage"
      :current-page="currentPage"
      small
    ></b-table>
  </div>
</template>

<script>
  export default {
    data() {
      return {
        perPage: 3,
        currentPage: 1,
        items: [
          { id: 1, first_name: 'Fred', last_name: 'Flintstone' },
          { id: 2, first_name: 'Wilma', last_name: 'Flintstone' },
          { id: 3, first_name: 'Barney', last_name: 'Rubble' },
          { id: 4, first_name: 'Betty', last_name: 'Rubble' },
          { id: 5, first_name: 'Pebbles', last_name: 'Flintstone' },
          { id: 6, first_name: 'Bamm Bamm', last_name: 'Rubble' },
          { id: 7, first_name: 'The Great', last_name: 'Gazzoo' },
          { id: 8, first_name: 'Rockhead', last_name: 'Slate' },
          { id: 9, first_name: 'Pearl', last_name: 'Slaghoople' }
        ]
      }
    },
    computed: {
      rows() {
        return this.items.length
      }
    }
  }
</script>

and this is happening:

enter image description here

I just copied the documentation example and it's not working. My project uses Vue 3.3.4 and bootstrap-vue-3 (^0.5.1)

2 Answers 2

0

In the link you provided, click "Getting Started" in the left navigation bar. You'll be able to read:

  • Vue.js v2.6 is required, v2.6.12 is recommended
  • Bootstrap v4.3.1 is required, v4.6.1 is recommended
  • ...

If you want to use bootstrap-vue with Vue 3, click the "Vue 3" link in the top bar and follow instructions. However, it is not guaranteed everything will work.

Sign up to request clarification or add additional context in comments.

Comments

0

bootstrap-vue-3 is deprecated and a separate project entirely to the documentation you've linked.

bootstrap-vue-3 was renamed to bootstrap-vue-next, which you can find here, along with the proper documentation.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.