pnpm create vite
选择vue和JavaScript
pnpm i ant-design-vue pnpm i @antv/g2plot pnpm i vue-router
{ "name": "frontend", "private": true, "version": "0.0.0", "type": "module", "scripts": { "dev": "vite", "build": "vite build", "preview": "vite preview" }, "dependencies": { "@antv/g2plot": "^2.4.31", "ant-design-vue": "^4.2.3", "vue": "^3.4.29", "vue-router": "^4.4.0" }, "devDependencies": { "@vitejs/plugin-vue": "^5.0.5", "vite": "^5.3.1" } }
import {createApp} from 'vue' import Antd from 'ant-design-vue'; import router from './router'; import 'ant-design-vue/dist/reset.css'; import App from './App.vue' const app = createApp(App) app.use(Antd) app.use(router) app.mount('#app')
import {createWebHashHistory, createRouter} from 'vue-router' import Layout from '../page/layout/index.vue' import Home from '../page/home/index.vue' import LineQuickStart from '../page/line/quick_start.vue' const routes = [ { path: '/', component: Layout, redirect: '/home', children: [ {path: "/home", component: Home}, {path: "/line/quickstart", component: LineQuickStart}, ] }, ] const router = createRouter({ history: createWebHashHistory(), routes, }) export default router
首页 折线图 快速入门 版权所有 © 2024 Python私教 张大鹏
home