From fad2c220afd503e87ee4e050da194fc9679e88e1 Mon Sep 17 00:00:00 2001 From: bighuixiang <472705331@qq.com> Date: Sun, 22 Jun 2025 15:20:08 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E4=BF=AE=E5=A4=8Dicon=E6=98=BE?= =?UTF-8?q?=E7=A4=BA=E9=97=AE=E9=A2=98=E5=92=8C=E6=B7=BB=E5=8A=A0=E7=BA=A2?= =?UTF-8?q?=E7=BB=BF=E5=9B=BE=E6=A8=A1=E5=BC=8F=E7=A4=BA=E4=BE=8B=E7=BB=84?= =?UTF-8?q?=E4=BB=B6=E5=B9=B6=E6=9B=B4=E6=96=B0=E8=B7=AF=E7=94=B1=E9=85=8D?= =?UTF-8?q?=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/component/Canvas/RedGreenModeExample.vue | 89 +++++++++ src/component/Canvas/canvasExample.vue | 196 +++++++++++++++++++ src/main.ts | 6 +- src/router/index.ts | 7 + vite.config.js | 11 +- 5 files changed, 302 insertions(+), 7 deletions(-) create mode 100644 src/component/Canvas/RedGreenModeExample.vue create mode 100644 src/component/Canvas/canvasExample.vue diff --git a/src/component/Canvas/RedGreenModeExample.vue b/src/component/Canvas/RedGreenModeExample.vue new file mode 100644 index 00000000..8fc88562 --- /dev/null +++ b/src/component/Canvas/RedGreenModeExample.vue @@ -0,0 +1,89 @@ + + + + + diff --git a/src/component/Canvas/canvasExample.vue b/src/component/Canvas/canvasExample.vue new file mode 100644 index 00000000..c2873f4d --- /dev/null +++ b/src/component/Canvas/canvasExample.vue @@ -0,0 +1,196 @@ + + + + + diff --git a/src/main.ts b/src/main.ts index ee6905b5..17b8bf5a 100644 --- a/src/main.ts +++ b/src/main.ts @@ -17,13 +17,13 @@ import "../node_modules/@flaticon/flaticon-uicons/css/all/all.css"; import "swiper/css"; import "swiper/css/pagination"; import SvgIcon from "@/component/Canvas/SvgIcon/index.vue"; - +import "virtual:svg-icons-register"; // import "@/tool/color-thief.js"; // import "@/tool/fabric.brushes.js"; // import "@/tool/fabric.min.js"; const app = createApp(App); -flexible() +flexible(); // alert(window.innerWidth) import { getCookie, setCookie } from "@/tool/cookie"; import loadingGif from "./assets/images/homePage/loading.gif"; @@ -40,6 +40,6 @@ app .use(router) .use(Antd) .use(VueLazyload, loadingParam) -.component("SvgIcon", SvgIcon) + .component("SvgIcon", SvgIcon) .use(i18n) .mount("#app"); diff --git a/src/router/index.ts b/src/router/index.ts index b2045259..2d6b200f 100644 --- a/src/router/index.ts +++ b/src/router/index.ts @@ -22,6 +22,13 @@ const routes: Array = [ meta: { enter: "all" }, component: () => import("@/views/Login.vue"), }, + { + path: "/canvasExample", + name: "canvasExample", + meta: { enter: "all" }, + component: () => import("@/component/Canvas/canvasExample.vue"), + }, + { path: "/schoolLogin", name: "schoolLogin", diff --git a/vite.config.js b/vite.config.js index 36cae19f..1b24aca8 100644 --- a/vite.config.js +++ b/vite.config.js @@ -5,7 +5,7 @@ import { AntDesignVueResolver } from "unplugin-vue-components/resolvers"; import AutoImport from "unplugin-auto-import/vite"; import { createSvgIconsPlugin } from "vite-plugin-svg-icons"; import path from "path"; -import { ElementPlusResolver } from 'unplugin-vue-components/resolvers' +import { ElementPlusResolver } from "unplugin-vue-components/resolvers"; // https://vite.dev/config/ export default defineConfig(({ mode }) => { @@ -15,16 +15,19 @@ export default defineConfig(({ mode }) => { return { resolve: { alias: { - '@': path.resolve(__dirname, './src'), + "@": path.resolve(__dirname, "./src"), }, }, plugins: [ vue(), Components({ - resolvers: [AntDesignVueResolver({ importStyle: false }),ElementPlusResolver()], + resolvers: [ + AntDesignVueResolver({ importStyle: false }), + ElementPlusResolver(), + ], }), AutoImport({ - resolvers: [ElementPlusResolver()], + resolvers: [ElementPlusResolver()], imports: [ "vue", "vue-router",