Edit pages/samples/_id.vue
<template> <div> <h1>ID: {{ $route.params.id }} == {{ pageId }}</h1> </div></template><script>export default { /* validate ({ params }) { // Must be a number return /^\d+$/.test(params.id) }, */ async asyncData ({ $axios, params }) { const { data } = await $axios.get(`/data/page-${params.id}.json`) return data }, data() { return { pageId: parseInt(this.$route.params.id) } }}</script>