摘要:
一、安装 npm install pinia 二、构建(main.ts) 1、引入 2、生成 3、使用 import { createApp } from 'vue' import App from './App.vue' import router from '@/router' // 1.引入 阅读全文
posted @ 2025-03-16 21:37
市丸银
阅读(126)
评论(0)
推荐(0)
摘要:
一、区别 1、获取路由器 let router = useRouter() 2、使用 router.push({ name:'detail', query:news }) 二、案例 <template> <ul> <button v-for="news in newList" :key="news. 阅读全文
posted @ 2025-03-16 19:40
市丸银
阅读(41)
评论(0)
推荐(0)
摘要:
一、params简写 1、路由 props: true 注意:只能params传参可以使用 { name:'detail', path:'detail/:id/:name/:content?', component:()=>import('@/views/Detail.vue'), props: t 阅读全文
posted @ 2025-03-16 19:18
市丸银
阅读(58)
评论(0)
推荐(0)
摘要:
一、区别 let route = useRoute() 注意: 1、params参数可选可不选,参数占位后面+? 2、path占位符 3、使用name 二、案例 1、跳转 <template> <ul> <RouterLink :to="{ name:'detail', params: news } 阅读全文
posted @ 2025-03-16 18:56
市丸银
阅读(81)
评论(0)
推荐(0)
摘要:
一、区别 没有 this.route let route = userRoute() route 相当于 this.route 二、路由 <template> <ul> <RouterLink :to="{ path:'/news/detail', query:news }" v-for="news 阅读全文
posted @ 2025-03-16 18:41
市丸银
阅读(73)
评论(0)
推荐(0)

浙公网安备 33010602011771号