-
工业脚轮万向轮类网站...
-
集团企业通用类网站pb...
-
输送机设备类网站pboot...
-
网络建站公司类网站pb...
-
家政服务公司网站pboot...
-
矿山矿石设备类网站pb...
-
高端装修设计公司类网站...
-
新能源汽车充电桩设备类...
-
企业咨询管理类网站pb...
-
电子监控系统类网站pb...
-
宽屏滚屏塑料制品类网站...
-
照明科技类网站pbootcms模...
-
货架货柜类网站pbootcms模...
-
健身俱乐部类网站pboot...
-
饰品首饰珠宝类网站pb...
-
环保防腐木材类网站pb...
-
站长导航类网站pbootcms模...
-
全屋定制家居装饰类网站...
-
电缆电线类网站pbootcms模...
-
国际物流服务类网站pb...
1. 使用路由导航(Vue Router)进行页面跳转:
// 在路由配置文件中定义路由
import { createRouter, createWebHistory } from 'vue-router';
const routes = [
{ path: '/', component: Home },
{ path: '/about', component: About },
// ...
];
const router = createRouter({
history: createWebHistory(),
routes,
});
// 在组件中使用路由导航
<template>
<button @click="goToAbout">Go to About</button>
</template>
2. 使用`<router-link>`组件进行页面跳转:<script>
import { useRouter } from 'vue-router';
export default {
methods: {
goToAbout() {
const router = useRouter();
router.push('/about');
},
},
};
</script>
3. 使用`window.location`进行页面跳转:<template>
<router-link to="/about">Go to About</router-link>
</template>
4. 使用`<a>`标签进行页面跳转:<template>
<button @click="goToAbout">Go to About</button>
</template>
<script>
export default {
methods: {
goToAbout() {
window.location.href = '/about';
},
},
};
</script>
这些是一些常见的页面跳转方式,你可以根据具体的需求选择适合的方式来实现页面跳转。<template>
<a href="/about">Go to About</a>
</template>