当前位置:网站首页>路由-Tab切换页面
路由-Tab切换页面
2022-08-02 12:49:00 【给我来个鸡腿】
效果
代码结构
代码
router.js
import { createRouter, createWebHashHistory } from 'vue-router'
import Page1 from '../views/Page1.vue'
import Page2 from '../views/Page2.vue'
import Page3 from '../views/Page3.vue'
const routes = [
{
path: '/page1',
component: Page1
},
{
path: '/page2',
component: Page2
},
{
path: '/page3',
component: Page3
}
]
const router = createRouter({
history: createWebHashHistory(),
routes
})
export default router
app.vue
<template>
<Tab />
<router-view />
</template>
<script setup>
import Tab from '@/components/tab'
</script>
<style>
</style>
tab.vue
<template>
<div class="tab">
<router-link tag="div" to="/page1" class="tab-item">Page1</router-link>
<router-link tag="div" to="/page2" class="tab-item">Page2</router-link>
<router-link tag="div" to="/page3" class="tab-item">Page2</router-link>
</div>
</template>
边栏推荐
猜你喜欢
js半圆环加载进度动画js特效
以Boost为例的type3电压环补偿器实例
Data Lake (3): Hudi Concept Terminology
FreeRTOS实验--一个函数创建多个任务
Taurus.MVC V3.0.3 Microservice Open Source Framework Released: Make the evolution of .NET architecture easier in large concurrency.
Process finished with exit code 1
PHP+MYSQL【学生信息管理系统】(极简版)
DTG-SSOD: The latest semi-supervised detection framework, Dense Teacher (with paper download)
simulink PID自动整定
An example of type3 voltage loop compensator taking Boost as an example
随机推荐
智能图像分析-智能家用电器图像目标检测统计计数检测与识别-艾科瑞特科技(iCREDIT)
numpy&pands 中的unique
ssm access database data error
干测试这些年,去过阿里也去过小公司,给年轻测试员们一个忠告...
How to set up wireless PPI communication between Weiluntong touch screen and S7-200smart?
Intouch Historian历史曲线配置导入导出
LeetCode_139_单词拆分
新特性解读 | MySQL 8.0 GIPK 不可见主键
企业用直播平台能实现什么
FreeRTOS experiment -- delete task
工厂方法模式
PHP+MYSQL [Student Information Management System] (Minimalist Edition)
Seneor Exposure Basics
LeetCode_139_word split
php——三篇夯实根基第一篇
手撸架构,Redis面试41问
After Effects 教程,如何在 After Effects 中对蒙版进行动画绘制?
Basic protocol explanation
TFRecord简介,原理分析,代码实现?[通俗易懂]
js源码跳转的几种方式,在当前页面跳转,在空白页跳转