-
生活服务类网站pbootcms模...
-
简洁个人博客资讯类网站...
-
中英双语户外篷房帐篷类...
-
电动闸门伸缩门类网站...
-
重工机械设备类网站pb...
-
睡前故事资讯类网站pb...
-
激光切割机类网站pboot...
-
数码产品类网站pbootcms模...
-
站长技术博客类网站pb...
-
游乐设备厂家类网站pb...
-
锅炉制造石化装备类网站...
-
博客类网站pbootcms模板...
-
纸盒包装类网站pbootcms模...
-
蔬菜配送类网站pbootcms模...
-
AR技术软件开发类网站...
-
画册包装设计类网站pb...
-
精密轴承类网站pbootcms模...
-
高端网站建设网站pboot...
-
货运物流快递类网站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>


