how send to another page by router in vuejs

// Step 1: Import Vue and VueRouter
import Vue from 'vue'
import VueRouter from 'vue-router'

// Step 2: Use VueRouter
Vue.use(VueRouter)

// Step 3: Define your routes
const routes = [
  { path: '/page1', component: Page1 },
  { path: '/page2', component: Page2 }
]

// Step 4: Create a router instance and pass in the routes
const router = new VueRouter({
  routes
})

// Step 5: Create Vue instance and pass in the router
new Vue({
  router,
  render: h => h(App)
}).$mount('#app')
<!-- Step 6: Create navigation links in your template -->
<router-link to="/page1">Go to Page 1</router-link>
<router-link to="/page2">Go to Page 2</router-link>
<!-- Step 7: Add a <router-view> to display the component of the current route -->
<router-view></router-view>
// Step 8: In your component, use $router.push to navigate to another page
export default {
  methods: {
    navigateToPage1() {
      this.$router.push('/page1')
    },
    navigateToPage2() {
      this.$router.push('/page2')
    }
  }
}
<!-- Step 9: Trigger the navigation in your template -->
<button @click="navigateToPage1">Go to Page 1</button>
<button @click="navigateToPage2">Go to Page 2</button>