Vue-Router
本文最后更新于304 天前,其中的信息可能已经过时,如有错误请发送邮件到3368129372@qq.com

来源于官网:https://router.vuejs.org/

新建导航

目录如下:
config
|———route.vue

代码如下:

import Index from "../pages/Index.vue";

const routes = [
    { path: '/index', component: Index },
]

其中界面写在:
pages
|————Index.vue

跳转路由

const onClickRight = () => {
  router.push("/rightPage")
};

携带参数跳转(query参数将数据写在url中)

const toEdit = (editKey: string, editName: string,currentValue: string) => {
  router.push({
    path: "/user/edit",
    query: {
      editName,
      editKey,
      currentValue,
    }
    replace: true//这个代表从路由中删掉当前路径,返回方法也无法使用
  })
}

取出参数:

const route = useRoute();
console.log(route.query);
感谢您的收看~

评论

发送评论 编辑评论


				
|´・ω・)ノ
ヾ(≧∇≦*)ゝ
(☆ω☆)
(╯‵□′)╯︵┴─┴
 ̄﹃ ̄
(/ω\)
∠( ᐛ 」∠)_
(๑•̀ㅁ•́ฅ)
→_→
୧(๑•̀⌄•́๑)૭
٩(ˊᗜˋ*)و
(ノ°ο°)ノ
(´இ皿இ`)
⌇●﹏●⌇
(ฅ´ω`ฅ)
(╯°A°)╯︵○○○
φ( ̄∇ ̄o)
ヾ(´・ ・`。)ノ"
( ง ᵒ̌皿ᵒ̌)ง⁼³₌₃
(ó﹏ò。)
Σ(っ °Д °;)っ
( ,,´・ω・)ノ"(´っω・`。)
╮(╯▽╰)╭
o(*////▽////*)q
>﹏<
( ๑´•ω•) "(ㆆᴗㆆ)
😂
😀
😅
😊
🙂
🙃
😌
😍
😘
😜
😝
😏
😒
🙄
😳
😡
😔
😫
😱
😭
💩
👻
🙌
🖕
👍
👫
👬
👭
🌚
🌝
🙈
💊
😶
🙏
🍦
🍉
😣
Source: github.com/k4yt3x/flowerhd
颜文字
Emoji
小恐龙
花!
上一篇
下一篇