@mc-markets/ui 1.0.94 → 1.0.95

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/QUICK_START.md CHANGED
@@ -40,7 +40,11 @@ export default defineConfig({
40
40
  plugins: [
41
41
  vue(),
42
42
  Components({
43
- resolvers: [McMarketsUIResolver()]
43
+ resolvers: [
44
+ McMarketsUIResolver({
45
+ importStyle: 'css' // 自动导入样式(包括字体图标)
46
+ })
47
+ ]
44
48
  }),
45
49
  AutoImport({
46
50
  imports: ['vue', getMcMarketsUIImports()],
@@ -50,6 +54,14 @@ export default defineConfig({
50
54
  })
51
55
  ```
52
56
 
57
+ **注意:** 如果样式未生效,请在 `src/main.js` 中手动导入:
58
+
59
+ ```javascript
60
+ import '@mc-markets/ui/dist/style.css'
61
+ import '@mc-markets/ui/styles/font'
62
+ import '@mc-markets/ui/styles/colorfont'
63
+ ```
64
+
53
65
  ### 4. 更新 TypeScript 配置(如果使用 TS)
54
66
 
55
67
  修改 `tsconfig.json`,添加生成的类型文件:
package/USAGE_GUIDE.md CHANGED
@@ -251,12 +251,26 @@ export default defineNuxtConfig({
251
251
 
252
252
  ### Q: 样式没有加载?
253
253
 
254
- **A:**
255
- 1. 如果使用自动导入,确保 `McMarketsUIResolver` 的 `importStyle` 选项为 `true`(默认)
256
- 2. 或者手动在 `main.js` 中导入:
257
- ```javascript
258
- import '@mc-markets/ui/dist/style.css'
259
- ```
254
+ **A:** 推荐使用以下方式确保样式正确加载:
255
+
256
+ **方式1:手动导入(推荐,最可靠)**
257
+ ```javascript
258
+ // main.js
259
+ import '@mc-markets/ui/dist/style.css'
260
+ import '@mc-markets/ui/styles/font'
261
+ import '@mc-markets/ui/styles/colorfont'
262
+ ```
263
+
264
+ **方式2:自动导入(配置 resolver)**
265
+ ```javascript
266
+ Components({
267
+ resolvers: [
268
+ McMarketsUIResolver({
269
+ importStyle: 'css' // 自动导入所有样式(主样式 + 字体图标)
270
+ })
271
+ ]
272
+ })
273
+ ```
260
274
 
261
275
  ### Q: 如何使用 Element Plus 的原始组件?
262
276