Selaa lähdekoodia

ui组件库导入成功

yuanmingze 8 kuukautta sitten
vanhempi
commit
166be94402
5 muutettua tiedostoa jossa 30 lisäystä ja 4 poistoa
  1. 3 2
      package.json
  2. 14 1
      pnpm-lock.yaml
  3. 1 0
      src/pages.json
  4. 6 0
      src/pages/index/index.vue
  5. 6 1
      tsconfig.json

+ 3 - 2
package.json

@@ -40,7 +40,8 @@
     "pinia-plugin-persistedstate": "^4.7.1",
     "qs": "^6.14.1",
     "vue": "^3.4.21",
-    "vue-i18n": "^9.1.9"
+    "vue-i18n": "^9.1.9",
+    "wot-design-uni": "^1.14.0"
   },
   "devDependencies": {
     "@dcloudio/types": "^3.4.8",
@@ -64,7 +65,7 @@
     "eslint-plugin-vue": "^10.6.2",
     "jsonc-parser": "^3.3.1",
     "prettier": "^3.7.4",
-    "sass": "^1.97.2",
+    "sass": "^1.78.0",
     "tsx": "^4.21.0",
     "typescript": "^4.9.4",
     "vite": "5.2.8",

+ 14 - 1
pnpm-lock.yaml

@@ -86,6 +86,9 @@ importers:
       vue-i18n:
         specifier: ^9.1.9
         version: 9.14.5(vue@3.5.26(typescript@4.9.5))
+      wot-design-uni:
+        specifier: ^1.14.0
+        version: 1.14.0(vue@3.5.26(typescript@4.9.5))
     devDependencies:
       '@dcloudio/types':
         specifier: ^3.4.8
@@ -151,7 +154,7 @@ importers:
         specifier: ^3.7.4
         version: 3.7.4
       sass:
-        specifier: ^1.97.2
+        specifier: ^1.78.0
         version: 1.97.2
       tsx:
         specifier: ^4.21.0
@@ -4373,6 +4376,12 @@ packages:
     resolution: {integrity: sha512-BN22B5eaMMI9UMtjrGd5g5eCYPpCPDUy0FJXbYsaT5zYxjFOckS53SQDE3pWkVoWpHXVb3BrYcEN4Twa55B5cA==}
     engines: {node: '>=0.10.0'}
 
+  wot-design-uni@1.14.0:
+    resolution: {integrity: sha512-FaBXtmxxAkZNZUxR2xeKBg/Agck+SPaFFFeCvbBzAFeqM/5m2Y/v/7te7rhMJpZFkMoAgtJR1yaWR0DnjOmTnA==}
+    engines: {HBuilderX: ^3.8.7}
+    peerDependencies:
+      vue: '>=3.2.47'
+
   wrap-ansi@7.0.0:
     resolution: {integrity: sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==}
     engines: {node: '>=10'}
@@ -9680,6 +9689,10 @@ snapshots:
 
   word-wrap@1.2.5: {}
 
+  wot-design-uni@1.14.0(vue@3.5.26(typescript@4.9.5)):
+    dependencies:
+      vue: 3.5.26(typescript@4.9.5)
+
   wrap-ansi@7.0.0:
     dependencies:
       ansi-styles: 4.3.0

+ 1 - 0
src/pages.json

@@ -2,6 +2,7 @@
   "easycom": {
     "autoscan": true,
     "custom": {
+      "^wd-(.*)": "wot-design-uni/components/wd-$1/wd-$1.vue",
       // uni-ui 规则如下配置
       "^uni-(.*)": "@dcloudio/uni-ui/lib/uni-$1/uni-$1.vue"
     }

+ 6 - 0
src/pages/index/index.vue

@@ -8,6 +8,12 @@
     <uni-badge text="1"></uni-badge>
     <uni-badge text="2" type="success"></uni-badge>
     <uni-badge text="3" type="primary" :inverted="true"></uni-badge>
+
+    <wd-button>主要按钮</wd-button>
+    <wd-button type="success">成功按钮</wd-button>
+    <wd-button type="info">信息按钮</wd-button>
+    <wd-button type="warning">警告按钮</wd-button>
+    <wd-button type="error">危险按钮</wd-button>
   </view>
 </template>
 

+ 6 - 1
tsconfig.json

@@ -7,7 +7,12 @@
       "@/*": ["./src/*"]
     },
     "lib": ["esnext", "dom"],
-    "types": ["@dcloudio/types", "@uni-helper/uni-app-types", "@uni-helper/uni-ui-types"]
+    "types": [
+      "@dcloudio/types",
+      "@uni-helper/uni-app-types",
+      "@uni-helper/uni-ui-types",
+      "wot-design-uni/global"
+    ]
   },
   "include": ["src/**/*.ts", "src/**/*.d.ts", "src/**/*.tsx", "src/**/*.vue"]
 }