diff --git a/components.d.ts b/components.d.ts
index 8a1ab83..da40ba6 100644
--- a/components.d.ts
+++ b/components.d.ts
@@ -13,6 +13,7 @@ declare module 'vue' {
ElBreadcrumb: typeof import('element-plus/es')['ElBreadcrumb']
ElBreadcrumbItem: typeof import('element-plus/es')['ElBreadcrumbItem']
ElButton: typeof import('element-plus/es')['ElButton']
+ ElCard: typeof import('element-plus/es')['ElCard']
ElCarousel: typeof import('element-plus/es')['ElCarousel']
ElCarouselItem: typeof import('element-plus/es')['ElCarouselItem']
ElCascader: typeof import('element-plus/es')['ElCascader']
@@ -27,7 +28,6 @@ declare module 'vue' {
ElEmpty: typeof import('element-plus/es')['ElEmpty']
ElForm: typeof import('element-plus/es')['ElForm']
ElFormItem: typeof import('element-plus/es')['ElFormItem']
- ElHeader: typeof import('element-plus/es')['ElHeader']
ElIcon: typeof import('element-plus/es')['ElIcon']
ElImage: typeof import('element-plus/es')['ElImage']
ElInput: typeof import('element-plus/es')['ElInput']
@@ -35,7 +35,6 @@ declare module 'vue' {
ElMenu: typeof import('element-plus/es')['ElMenu']
ElMenuItem: typeof import('element-plus/es')['ElMenuItem']
ElOption: typeof import('element-plus/es')['ElOption']
- ElPageHeader: typeof import('element-plus/es')['ElPageHeader']
ElPagination: typeof import('element-plus/es')['ElPagination']
ElPopconfirm: typeof import('element-plus/es')['ElPopconfirm']
ElProgress: typeof import('element-plus/es')['ElProgress']
diff --git a/package-lock.json b/package-lock.json
index f456675..f3cfd16 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -42,6 +42,7 @@
"@vitejs/plugin-vue-jsx": "^3.0.2",
"@vue/tsconfig": "^0.4.0",
"npm-run-all2": "^6.1.1",
+ "postcss-px-to-viewport": "^1.1.1",
"sass": "^1.32.13",
"typescript": "~5.2.0",
"unplugin-auto-import": "^0.17.1",
@@ -3917,6 +3918,17 @@
"node": "^10 || ^12 || >=14"
}
},
+ "node_modules/postcss-px-to-viewport": {
+ "version": "1.1.1",
+ "resolved": "https://repo.huaweicloud.com/repository/npm/postcss-px-to-viewport/-/postcss-px-to-viewport-1.1.1.tgz",
+ "integrity": "sha512-2x9oGnBms+e0cYtBJOZdlwrFg/mLR4P1g2IFu7jYKvnqnH/HLhoKyareW2Q/x4sg0BgklHlP1qeWo2oCyPm8FQ==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "object-assign": ">=4.0.1",
+ "postcss": ">=5.0.2"
+ }
+ },
"node_modules/process-nextick-args": {
"version": "2.0.1",
"resolved": "https://repo.huaweicloud.com/repository/npm/process-nextick-args/-/process-nextick-args-2.0.1.tgz",
diff --git a/package.json b/package.json
index dfbf9f9..6ee0cc2 100644
--- a/package.json
+++ b/package.json
@@ -48,6 +48,7 @@
"@vitejs/plugin-vue-jsx": "^3.0.2",
"@vue/tsconfig": "^0.4.0",
"npm-run-all2": "^6.1.1",
+ "postcss-px-to-viewport": "^1.1.1",
"sass": "^1.32.13",
"typescript": "~5.2.0",
"unplugin-auto-import": "^0.17.1",
diff --git a/postcss.config.js b/postcss.config.js
new file mode 100644
index 0000000..b9658e9
--- /dev/null
+++ b/postcss.config.js
@@ -0,0 +1,18 @@
+module.exports = {
+ plugins: {
+ 'postcss-px-to-viewport': {
+ viewportWidth: 1920, // 设计稿的视口宽度
+ viewportHeight: 1080, // 设计稿的视口宽度
+ viewportUnit: 'vw', // 希望使用的视口单位
+ fontViewportUnit: 'vw', // 字体使用的视口单位
+ unitPrecision: 5,
+ propList: ['*'],
+ selectorBlackList: ['.ignore'], // 需要忽略的CSS选择器
+ minPixelValue: 1, // 小于或等于`1px`不转换为视口单位
+ mediaQuery: false, // 允许在媒体查询中转换`px`
+ selectorBlackList: [':root', 'el-'], // 排除 Element Plus 的类名
+ // replace: true,
+ exclude: [/node_modules\/element-plus/], // 排除 Element Plus 的样式文件
+ },
+ },
+}
diff --git a/src/App.vue b/src/App.vue
index 17c5227..3b0b65d 100644
--- a/src/App.vue
+++ b/src/App.vue
@@ -1,5 +1,4 @@
-