@yh-ui/nuxt 0.1.21 → 0.1.22

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/README.md CHANGED
@@ -59,12 +59,14 @@ export default defineNuxtConfig({
59
59
  modules: ['@yh-ui/nuxt'],
60
60
 
61
61
  yhUI: {
62
- importStyle: true, // 自动注入主题样式,默认 true
62
+ importStyle: true, // 默认即为 true:自动注入 CSS 样式
63
63
  locale: 'zh-CN' // 默认语言,支持 67 种语言代码
64
64
  }
65
65
  })
66
66
  ```
67
67
 
68
+ 开启 `importStyle` 时,Nuxt 模块内部实际注入的是公开 CSS 入口 `@yh-ui/components/style`,不会依赖应用侧的 Sass 环境。
69
+
68
70
  ### 第 2 步:直接使用组件
69
71
 
70
72
  注册模块后,**所有 YhXxx 组件和 composable 自动导入**,无需任何额外配置:
@@ -126,16 +128,18 @@ const showNotification = () => {
126
128
  export default defineNuxtConfig({
127
129
  modules: ['@yh-ui/nuxt'],
128
130
  yhUI: {
129
- importStyle: true, // 是否自动注入样式,默认 true
131
+ importStyle: true, // 是否自动注入 CSS 样式;默认 true
130
132
  locale: 'zh-CN' // 默认语言代码
131
133
  }
132
134
  })
133
135
  ```
134
136
 
135
- | 选项 | 类型 | 默认值 | 说明 |
136
- | ------------- | --------- | --------- | ------------------------- |
137
- | `importStyle` | `boolean` | `true` | 是否自动注入组件样式 |
138
- | `locale` | `string` | `'zh-CN'` | 默认语言代码(67 种可选) |
137
+ | 选项 | 类型 | 默认值 | 说明 |
138
+ | ------------- | --------- | --------- | --------------------------- |
139
+ | `importStyle` | `boolean` | `true` | 是否自动注入 YH-UI CSS 样式 |
140
+ | `locale` | `string` | `'zh-CN'` | 默认语言代码(67 种可选) |
141
+
142
+ `importStyle` 为 `true` 时,实际注入路径为 `@yh-ui/components/style`。
139
143
 
140
144
  ---
141
145
 
package/dist/module.cjs CHANGED
@@ -33,7 +33,9 @@ const yhNuxtModule = kit.defineNuxtModule({
33
33
  const { resolve } = kit.createResolver((typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === 'SCRIPT' && _documentCurrentScript.src || new URL('module.cjs', document.baseURI).href)));
34
34
  kit.addPlugin(resolve("./runtime/plugin"));
35
35
  if (options.importStyle) {
36
- nuxt.options.css.push("@yh-ui/theme/src/styles/index.scss");
36
+ if (!nuxt.options.css.includes("@yh-ui/components/style")) {
37
+ nuxt.options.css.push("@yh-ui/components/style");
38
+ }
37
39
  }
38
40
  if (options.buildTranspile) {
39
41
  nuxt.options.build.transpile = nuxt.options.build.transpile || [];
package/dist/module.d.cts CHANGED
@@ -2,8 +2,8 @@ import * as _nuxt_schema from '@nuxt/schema';
2
2
 
3
3
  interface ModuleOptions {
4
4
  /**
5
- * Whether to automatically import styles.
6
- * If true, it will import `@yh-ui/theme/src/styles/index.scss`.
5
+ * Whether to automatically inject published CSS styles.
6
+ * If true, it will import `@yh-ui/components/style`.
7
7
  * @default true
8
8
  */
9
9
  importStyle?: boolean;
package/dist/module.d.mts CHANGED
@@ -2,8 +2,8 @@ import * as _nuxt_schema from '@nuxt/schema';
2
2
 
3
3
  interface ModuleOptions {
4
4
  /**
5
- * Whether to automatically import styles.
6
- * If true, it will import `@yh-ui/theme/src/styles/index.scss`.
5
+ * Whether to automatically inject published CSS styles.
6
+ * If true, it will import `@yh-ui/components/style`.
7
7
  * @default true
8
8
  */
9
9
  importStyle?: boolean;
package/dist/module.d.ts CHANGED
@@ -2,8 +2,8 @@ import * as _nuxt_schema from '@nuxt/schema';
2
2
 
3
3
  interface ModuleOptions {
4
4
  /**
5
- * Whether to automatically import styles.
6
- * If true, it will import `@yh-ui/theme/src/styles/index.scss`.
5
+ * Whether to automatically inject published CSS styles.
6
+ * If true, it will import `@yh-ui/components/style`.
7
7
  * @default true
8
8
  */
9
9
  importStyle?: boolean;
package/dist/module.mjs CHANGED
@@ -26,7 +26,9 @@ const yhNuxtModule = defineNuxtModule({
26
26
  const { resolve } = createResolver(import.meta.url);
27
27
  addPlugin(resolve("./runtime/plugin"));
28
28
  if (options.importStyle) {
29
- nuxt.options.css.push("@yh-ui/theme/src/styles/index.scss");
29
+ if (!nuxt.options.css.includes("@yh-ui/components/style")) {
30
+ nuxt.options.css.push("@yh-ui/components/style");
31
+ }
30
32
  }
31
33
  if (options.buildTranspile) {
32
34
  nuxt.options.build.transpile = nuxt.options.build.transpile || [];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@yh-ui/nuxt",
3
- "version": "0.1.21",
3
+ "version": "0.1.22",
4
4
  "description": "Nuxt module for YH-UI",
5
5
  "type": "module",
6
6
  "main": "./dist/module.cjs",
@@ -18,8 +18,8 @@
18
18
  ],
19
19
  "dependencies": {
20
20
  "@nuxt/kit": "^3.11.0 || ^4.0.0",
21
- "@yh-ui/components": "0.1.21",
22
- "@yh-ui/theme": "0.1.21"
21
+ "@yh-ui/components": "0.1.22",
22
+ "@yh-ui/theme": "0.1.22"
23
23
  },
24
24
  "devDependencies": {
25
25
  "@nuxt/schema": "^3.11.0 || ^4.0.0",