提交 4e19be74 编写于 作者: U ursulashan

Mon Aug 21 14:25:00 CST 2023 inscode

上级 7a093d7e
run = "npm i && npm run dev"
language = "node"
[deployment]
build = "npm i && npm run build"
......@@ -8,3 +9,6 @@ run = "npm run preview"
PATH = "/root/${PROJECT_DIR}/.config/npm/node_global/bin:/root/${PROJECT_DIR}/node_modules/.bin:${PATH}"
XDG_CONFIG_HOME = "/root/.config"
npm_config_prefix = "/root/${PROJECT_DIR}/.config/npm/node_global"
[debugger]
program = "main.js"
......@@ -8,7 +8,8 @@
},
"dependencies": {
"guess": "^1.0.2",
"vue": "^3.2.37"
"vue": "^3.2.37",
"vue-router": "^4.2.4"
},
"devDependencies": {
"@vitejs/plugin-vue": "^3.0.1",
......
......@@ -9,6 +9,7 @@ defineProps({
<template>
<div class="greetings">
<p>详情 ID: {{ $route.params.id }}</p>
<h1 class="green">{{ msg }}</h1>
<h3>
You’ve successfully created a project with
......
import { createApp } from 'vue'
import { createRouter, createWebHistory, createWebHashHistory } from 'vue-router';
import App from './App.vue'
import HelloWorld from './components/HelloWorld.vue'; // 根据实际情况修改路径
import './assets/main.css'
createApp(App).mount('#app')
const routes = [
{
path: '/hi/:id.htm',
component: HelloWorld
},
{
path: '/hi',
component: HelloWorld
},
// 其他路由配置
];
const router = createRouter({
history: createWebHistory(),
routes
});
const app = createApp(App);
app.use(router);
app.mount('#app');
......@@ -4,7 +4,10 @@ import vue from '@vitejs/plugin-vue'
// https://vitejs.dev/config/
export default defineConfig({
server: {
host: true
host: true,
proxy: {
'hi.htm': 'hi' // 请将 path-to-your-detail-htm-page 替换为实际路径
}
},
plugins: [vue()]
})
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册