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

     

相关内容

热门资讯

重大发现!新财神正版辅助挂(透... 重大发现!新财神正版辅助挂(透视)详情开挂辅助方法(有挂实锤)1、新财神正版辅助挂ai机器人多个强度...
如何分辨真伪!wpk辅助插件(... 如何分辨真伪!wpk辅助插件(透视)xpoker透视辅助(详细开挂辅助助手);1、xpoker透视辅...
一分钟揭秘!菠萝辅助器免费版的... 一分钟揭秘!菠萝辅助器免费版的功能介绍(透视)先前有开挂辅助神器;菠萝辅助器免费版的功能介绍免费下载...
一分钟揭秘!微信微乐辅助ios... 一分钟揭秘!微信微乐辅助ios(透视)总结开挂辅助软件(详细教程)一、微信微乐辅助ios软件透明挂的...
一分钟了解!pokemmo脚本... 一分钟了解!pokemmo脚本辅助(透视)原生有开挂辅助器是一款可以让一直输的玩家,快速成为一个“必...
专业讨论!心悦踢坑辅助软件(透... 专业讨论!心悦踢坑辅助软件(透视)wpk德州局透视(专业开挂辅助安装);心悦踢坑辅助软件免费下载原版...
一分钟了解!约局吧德州真的存在... 一分钟了解!约局吧德州真的存在透视(透视)解谜开挂辅助教程(有挂解惑)约局吧德州真的存在透视辅助器中...
我来分享!约局吧透视挂脚本(透... 我来分享!约局吧透视挂脚本(透视)切实有开挂辅助下载是一款可以让一直输的玩家,快速成为一个“必胜”的...
热门推荐!新道游挂(透视)大菠... 热门推荐!新道游挂(透视)大菠萝789辅助器下载(了解开挂辅助神器);热门推荐!新道游挂(透视)大菠...
揭秘攻略!上饶中至小程序辅助(... 揭秘攻略!上饶中至小程序辅助(透视)揭幕开挂辅助app(真实有挂)1、每一步都需要思考,不同水平的挑...