开启vue学习模式——想要把某一个`div`做成页面跳转该怎么实现

想要把某一个div做成页面跳转该怎么实现:

1.新建**.vue文件city.vue
2.去router文件夹下设置这个vue文件的路由代码如下

//从文件夹里引入要求显示的.vue页面
import City from '@/pages/city/City'

//设置路由配置
Vue.use(Router)

export default new Router({
  routes: [
    {
      path: '/',
      name: 'Home',
      component: Home
    },
    {
      path: '/city',
      name: 'City',
      component: City
    }
  ]
})

猜你喜欢

转载自blog.csdn.net/qq_37002901/article/details/83582936