-
环保设备研发制造类网站...
-
五金轴承推广落地页pb...
-
玻璃棉板环保类网站pb...
-
水果食品类网站pbootcms模...
-
铝合金门窗类网站pboot...
-
蛋糕面包食品类网站pb...
-
家庭装修设计类网站pb...
-
电商平台资讯新闻类网站...
-
货运物流快递类网站pb...
-
电脑系统软件下载类网站...
-
木制托盘类网站pbootcms模...
-
导航网站pbootcms模板(自适...
-
建材装饰公司类网站pb...
-
建筑工程膜结构类网站...
-
石材石业类网站pbootcms模...
-
园林苗木绿化工程类网站...
-
茶叶新闻资讯类网站pb...
-
电动平车类网站pbootcms模...
-
空气净化器环保节能设备...
-
工商注册财务代理记账类...
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>