欧美bbbwbbbw肥妇,免费乱码人妻系列日韩,一级黄片

vue點(diǎn)擊按鈕跳轉(zhuǎn)到另一個(gè)vue頁面實(shí)現(xiàn)方法

 更新時(shí)間:2023年08月02日 11:38:18   作者:ChangYan.  
這篇文章主要給大家介紹了關(guān)于vue點(diǎn)擊按鈕跳轉(zhuǎn)到另一個(gè)vue頁面的相關(guān)資料,文中通過示例代碼介紹的非常詳細(xì),對(duì)大家的學(xué)習(xí)或者工作具有一定的參考借鑒價(jià)值,需要的朋友可以參考下

首先需要對(duì)按鈕綁定一個(gè)函數(shù),然后在函數(shù)里進(jìn)行頁面路由的改變。這里要確保項(xiàng)目中已經(jīng)在使用vue-router。如圖,我想要跳轉(zhuǎn)到這個(gè)index.vue頁面

那么按鈕綁定的函數(shù)里的路徑應(yīng)該這么寫:

然后需要在router文件夾下的index.js里進(jìn)行該頁面的注冊:

最主要的是我紅框里的內(nèi)容

代碼如下

  {
    path: '/directory',
    component: Layout,
    name: 'Directory',
    meta: {
      title: 'Directory',
      icon: 'el-icon-s-cooperation'
    },
    redirect: '/directory/index',
    children: [
      {
        path: '',
        name: 'Directory',
        component: () => import('@/views/directory/index'),
        meta: { title: 'navRoute.directory', icon: 'el-icon-s-cooperation', roles: ['user'] }
      },
      {
        path: 'newfilter/index',
        name: 'Newfilter',
        hidden: true,
        component: () => import('@/views/directory/newfilter/index'),
        meta: { title: 'navRoute.newfilter', roles: ['user'] }
      },
      { path: '*', redirect: 'directory/index', hidden: true }
    ]
  },

然后就可以跳轉(zhuǎn)成功啦!

總結(jié)

到此這篇關(guān)于vue點(diǎn)擊按鈕跳轉(zhuǎn)到另一個(gè)vue頁面實(shí)現(xiàn)的文章就介紹到這了,更多相關(guān)vue點(diǎn)擊按鈕跳轉(zhuǎn)vue頁面內(nèi)容請搜索腳本之家以前的文章或繼續(xù)瀏覽下面的相關(guān)文章希望大家以后多多支持腳本之家!

相關(guān)文章

最新評(píng)論