unplugin-vue-router怎么配置?
unplugin-router" title="vue-router">vue-router怎么配置?
报错:[Vue Router warn]: No match found for location with path "/index"
vite.confing.ts
import { fileURLToPath, URL } from 'node:url'import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'
import VueRouter from 'unplugin-vue-router/vite'
// https://vitejs.dev/config/
export default defineConfig({
plugins: [
vue(),
VueRouter({
routesFolder: 'src/views',
}),
],
resolve: {
alias: {
'@': fileURLToPath(new URL('./src', import.meta.url))
}
}
})
src/views/index/vue
<script setup lang="ts"></script>
<template>
index123
</template>
以上是 unplugin-vue-router怎么配置? 的全部内容, 来源链接: utcz.com/p/935201.html