<kbd id="9plqc"><label id="9plqc"></label></kbd>

        <th id="9plqc"></th>
        1. <center id="9plqc"><video id="9plqc"></video></center>
          <sub id="9plqc"><form id="9plqc"><pre id="9plqc"></pre></form></sub>
          <nav id="9plqc"><form id="9plqc"><legend id="9plqc"></legend></form></nav>
          VUE參考 您所在的位置:網(wǎng)站首頁 屬蛇人今年運勢2020年每月運勢詳解 VUE參考

          VUE參考

          2025-07-18 13:25| 來源: 網(wǎng)絡整理| 查看: 265

          VUE參考---redirect重定向 一、總結 一句話總結: redirect重定向:{ path: '/', redirect: '/login' } // 2. 創(chuàng)建一個路由對象, 當 導入 vue-router 包之后,在 window 全局對象中,就有了一個 路由的構造函數(shù),叫做 VueRouter // 在 new 路由對象的時候,可以為 構造函數(shù),傳遞一個配置對象 var routerObj = new VueRouter({ // route // 這個配置對象中的 route 表示 【路由匹配規(guī)則】 的意思 routes: [ // 路由匹配規(guī)則 // 每個路由規(guī)則,都是一個對象,這個規(guī)則對象,身上,有兩個必須的屬性: // 屬性1 是 path, 表示監(jiān)聽 哪個路由鏈接地址; // 屬性2 是 component, 表示,如果 路由是前面匹配到的 path ,則展示 component 屬性對應的那個組件 // 注意: component 的屬性值,必須是一個 組件的模板對象, 不能是 組件的引用名稱; // { path: '/', component: login }, { path: '/', redirect: '/login' }, // 這里的 redirect 和 Node 中的 redirect 完全是兩碼事 { path: '/login', component: login }, { path: '/register', component: register } ], linkActiveClass: 'myactive' })

          ?

          ?

          ?

          二、redirect重定向

          博客對應課程的視頻位置:

          ?

          1 DOCTYPE html> 2 3 4 5 6 7 8 Document 9 10 11 12 13 .router-link-active, 14 .myactive { 15 color: red; 16 font-weight: 800; 17 font-style: italic; 18 font-size: 80px; 19 text-decoration: underline; 20 background-color: green; 21 } 22 23 .v-enter, 24 .v-leave-to { 25 opacity: 0; 26 transform: translateX(140px); 27 } 28 29 .v-enter-active, 30 .v-leave-active { 31 transition: all 0.5s ease; 32 } 33 34 35 36 37 38 39 40 41 42 43 登錄 44 注冊 45 46 47 48 49 50 51 52 53 54 55 56 // 組件的模板對象 57 var login = { 58 template: '登錄組件' 59 } 60 61 var register = { 62 template: '注冊組件' 63 } 64 65 66 /* Vue.component('login', { 67 template: '登錄組件' 68 }) */ 69 70 // 2. 創(chuàng)建一個路由對象, 當 導入 vue-router 包之后,在 window 全局對象中,就有了一個 路由的構造函數(shù),叫做 VueRouter 71 // 在 new 路由對象的時候,可以為 構造函數(shù),傳遞一個配置對象 72 var routerObj = new VueRouter({ 73 // route // 這個配置對象中的 route 表示 【路由匹配規(guī)則】 的意思 74 routes: [ // 路由匹配規(guī)則 75 // 每個路由規(guī)則,都是一個對象,這個規(guī)則對象,身上,有兩個必須的屬性: 76 // 屬性1 是 path, 表示監(jiān)聽 哪個路由鏈接地址; 77 // 屬性2 是 component, 表示,如果 路由是前面匹配到的 path ,則展示 component 屬性對應的那個組件 78 // 注意: component 的屬性值,必須是一個 組件的模板對象, 不能是 組件的引用名稱; 79 // { path: '/', component: login }, 80 { path: '/', redirect: '/login' }, // 這里的 redirect 和 Node 中的 redirect 完全是兩碼事 81 { path: '/login', component: login }, 82 { path: '/register', component: register } 83 ], 84 linkActiveClass: 'myactive' 85 }) 86 87 // 創(chuàng)建 Vue 實例,得到 ViewModel 88 var vm = new Vue({ 89 el: '#app', 90 data: {}, 91 methods: {}, 92 router: routerObj // 將路由規(guī)則對象,注冊到 vm 實例上,用來監(jiān)聽 URL 地址的變化,然后展示對應的組件 93 }); 94 95 96 97

          ?

          ?

          ?

          ?


          【本文地址】

          公司簡介

          聯(lián)系我們

          今日新聞

          推薦新聞

          專題文章
            CopyRight 2018-2019 實驗室設備網(wǎng) 版權所有
            黄色免费网站在线看,韩国精品在线观看,韩国美女一区二区,99国产热 望奎县| 怀柔区| 桂东县| 大洼县| 罗甸县| 同仁县| 新竹市| 刚察县| 韩城市| 齐齐哈尔市| 凤冈县| 合肥市| 拉萨市| 孙吴县| 萝北县| 松阳县| 松潘县| 温泉县| 台州市| 湛江市| 武山县| 延吉市| 南平市| 渝中区| 景泰县| 辽宁省| 六安市| 安徽省| 方山县| 鄂伦春自治旗| 梁河县| 洱源县| 荣成市| 平泉县| 绥化市| 纳雍县| 长乐市| 阿尔山市| 滦平县| 彭州市| 奎屯市| http://444 http://444 http://444 http://444 http://444 http://444