From ffaf4c8d44aebdb873ba44753d79dbde49864d68 Mon Sep 17 00:00:00 2001
From: X1627315083 <1627315083@qq.com>
Date: Thu, 9 Oct 2025 11:20:35 +0800
Subject: [PATCH] =?UTF-8?q?rem=E5=9F=BA=E5=87=86=E4=B8=BA1080?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/assets/icons/Vector.svg | 3 +++
src/main.ts | 7 ++++---
src/router/index.ts | 6 ++++++
src/utils/flexible.js | 13 +++++++------
src/views/Workshop/selectStyle.vue | 1 +
5 files changed, 21 insertions(+), 9 deletions(-)
create mode 100644 src/assets/icons/Vector.svg
diff --git a/src/assets/icons/Vector.svg b/src/assets/icons/Vector.svg
new file mode 100644
index 0000000..e7f5217
--- /dev/null
+++ b/src/assets/icons/Vector.svg
@@ -0,0 +1,3 @@
+
diff --git a/src/main.ts b/src/main.ts
index c6bd6ba..b43840e 100644
--- a/src/main.ts
+++ b/src/main.ts
@@ -7,6 +7,7 @@ import store from './stores/index'
import 'normalize.css/normalize.css'
import './assets/css/style.css'
import SvgIcon from "@/components/SvgIcon/index.vue";
+import "virtual:svg-icons-register";
import flexible from "./utils/flexible.js";
@@ -28,9 +29,9 @@ document.addEventListener('touchend', function(event) {
const app = createApp(App)
// app.use(ElementPlus)
app.use(router)
-app.use(store)
-app.component("SvgIcon", SvgIcon)
+.use(store)
+.component("SvgIcon", SvgIcon)
+.mount('#app')
flexible();
-app.mount('#app')
diff --git a/src/router/index.ts b/src/router/index.ts
index 84eee13..f4c5bc0 100644
--- a/src/router/index.ts
+++ b/src/router/index.ts
@@ -17,6 +17,12 @@ const router = createRouter({
// name: 'activitiesWorkshop',
// redirect: "/activities/workshop",
// },
+
+ {
+ path: '/workshop/selectStyle',
+ name: 'SelectStyle',
+ component: () => import('../views/Workshop/selectStyle.vue'),
+ },
]
diff --git a/src/utils/flexible.js b/src/utils/flexible.js
index f32a059..4594585 100644
--- a/src/utils/flexible.js
+++ b/src/utils/flexible.js
@@ -2,7 +2,7 @@ import { getUniversalZoomLevel } from '@/utils/tools'
let flexible = (designWidth, maxWidth,minWidth) =>{
var doc = document, win = window, docEl = doc.documentElement, remStyle = document.createElement("style"), tid;
- designWidth = designWidth || 1920;
+ designWidth = designWidth || 1080;
// maxWidth = maxWidth || 1920;
// minWidth = minWidth || 500;
// minWidth = minWidth || 1024;
@@ -13,11 +13,12 @@ let flexible = (designWidth, maxWidth,minWidth) =>{
height = getUniversalZoomLevel() * height
// width > maxWidth && (width = maxWidth);
// width < minWidth && (width = minWidth);
- if(width >= 1024){
- designWidth = 1920
- }else{
- designWidth = 375
- }
+
+ // if(width >= 1024){
+ // designWidth = 1920
+ // }else{
+ // designWidth = 375
+ // }
var rem = Math.round(width * 10 / designWidth);
docEl.style.fontSize = rem+'px'
remStyle.innerHTML = 'html{font-size:' + rem + 'px;}';
diff --git a/src/views/Workshop/selectStyle.vue b/src/views/Workshop/selectStyle.vue
index 22c5bfd..6cdafed 100644
--- a/src/views/Workshop/selectStyle.vue
+++ b/src/views/Workshop/selectStyle.vue
@@ -16,6 +16,7 @@ const {} = toRefs(data);