我正在使用Vue 3。我需要将登陆页面静态html页面链接到主路由
/
,这与vue 3原始index.html
完全不同。 HTML 文件包含大量第 3 方 CDN 样式表和脚本。我如何在与使用 vue 3 index.html
完全不同的任何路线上加载静态 html 页面?
是的,您可以这样做,前提是您的登陆页面位于 public/landing.html 中。然后,在 router/index.js:
routes: [
{
path: '/',
name: 'root',
component: LandingView
}, //... rest of routes
然后在LandingView.vue:
<template></template>
<script setup>
location.href = '/landing.html'
</script>
<style></style>