vue3+antd+g2plot快速入门
创始人
2025-01-08 12:05:42
0

创建项目

pnpm create vite 

选择vue和JavaScript

安装依赖

pnpm i ant-design-vue pnpm i @antv/g2plot pnpm i vue-router 

完整代码

package.json

{   "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"   } }  

src/main.js

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')  

src/App.vue

 

src/router/index.js

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 

src/page/layout/index.vue

     

src/home/index.vue

     

src/line/quick_start.vue

     

相关内容

热门资讯

透视神器“wepoker透视底... 透视神器“wepoker透视底牌脚本”一直真的是有挂(辅助挂)详细辅助普及教程;1、许多玩家不知道辅...
透视辅助!如何下载wpk透视版... 透视辅助!如何下载wpk透视版,广西友乐辅助app,黑科技教程(有挂教程)1、广西友乐辅助app系统...
最新技巧“潘潘讲故事辅助器”拱... 最新技巧“潘潘讲故事辅助器”拱趴大菠萝挂哪里(先前是有挂);小薇(透视辅助)致您一封信;亲爱潘潘讲故...
透视黑科技!hhpoker透视... 透视黑科技!hhpoker透视脚本,we-poker辅助(详细辅助可靠教程)是一款可以让一直输的玩家...
wepoker透视脚本免费!p... wepoker透视脚本免费!pokemmo辅助器,hhpoker辅助软件(详细辅助2025新版总结)...
透视模拟器!来玩app 德州 ... 透视模拟器!来玩app 德州 辅助,多多科技手游辅助(都是是有挂)一、多多科技手游辅助软件透明挂的定...
透视科技“aapoker透视插... 透视科技“aapoker透视插件下载”好像存在有挂(辅助挂)详细辅助专业教程;1、在ai机器人技巧中...
透视插件!uupoker有透视... 透视插件!uupoker有透视吗,新上游通用挂是真的吗,详细教程(有挂揭秘)1、新上游通用挂是真的吗...
玩家必看教程“福州十八扑外挂”... 玩家必看教程“福州十八扑外挂”wepoker公共底牌(切实存在有挂)准备好在福州十八扑外挂ia的高塔...
wepoker透视脚本下载!f... wepoker透视脚本下载!fishpoker透视底牌,hhpoker辅助软件下载(详细辅助可靠技巧...