1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

v-paginationにページURLのクエリパラメータを取得してページ更新後もページ数を指定して表示させる

Posted at
<v-pagination
  v-model="page"
  circle
  :length="pageLength"
  :total-visible="7"
  @input="executePageFeed"
></v-pagination>
data() {
  return {
    /**
     * ページャー
     */
    page: 1,
  }
}

async mounted() {
  /**
   ページ数をセット
   */
  await this.setPage()
},

methods: {
  setPage() {
    this.page = Number(this.$route.query.page) || 1
  }
}

参考:

v-pagination

Nuxt.jsでURLののクエリパラメータを取得する方法

Nuxt.jsのライフサイクルを知っておく

1
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?