mv-iconfront 1.0.6 → 1.0.7

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
@@ -80,10 +80,10 @@ import 'mv-iconfront/dist/style.css'
80
80
 
81
81
  组件确定图标颜色的顺序如下(优先级从高到低):
82
82
 
83
- 1. **`disabled`**: 如果为 `true`,强制显示 **灰色** (`#C0C4CC`)。
84
- 2. **`isRed`**: 如果为 `true`,强制显示 **红色** (`#f56c6c`)。
85
- 3. **`color`**: 如果提供了该属性,使用 **自定义颜色**。
86
- 4. **`defaultColor`**: 使用 `app.use()` 中配置的全局颜色 (未配置则默认为 `#FFFFFF`)。
83
+ 1. **`disabled`**: 如果为 `true`,强制显示 **灰色** (`#C0C4CC`)。
84
+ 2. **`isRed`**: 如果为 `true`,强制显示 **红色** (`#f56c6c`)。
85
+ 3. **`color`**: 如果提供了该属性,使用 **自定义颜色**。
86
+ 4. **`defaultColor`**: 使用 `app.use()` 中配置的全局颜色 (未配置则默认为 `#FFFFFF`)。
87
87
 
88
88
  ```html
89
89
  <!-- 示例:禁用状态优先级高于红色变体 -->
@@ -93,23 +93,23 @@ import 'mv-iconfront/dist/style.css'
93
93
 
94
94
  ## 属性 API (Props API)
95
95
 
96
- | 属性名 (Prop) | 类型 (Type) | 默认值 (Default) | 说明 (Description) |
97
- |---|---|---|---|
98
- | `name` | String | `''` | 具体的图标类名 (例如 `icon-a-qianse_tubiao_yichangbaocuo1`) |
99
- | `color` | String | `''` | 自定义颜色覆盖 (hex, rgb 等) |
100
- | `size` | String/Number | `''` | 字体大小。纯数字会被视为 `px` 单位。 |
101
- | `isRed` | Boolean | `false` | 设置图标为红色 (`#f56c6c`)。 |
102
- | `disabled` | Boolean | `false` | 设置图标为灰色 (`#C0C4CC`) 并将鼠标样式设为禁止。 |
103
-
96
+ | 属性名 (Prop) | 类型 (Type) | 默认值 (Default) | 说明 (Description) |
97
+ | ------------- | ------------- | ---------------- | ------------------------------------------------------------- |
98
+ | `name` | String | `''` | 具体的图标类名 (例如 `icon-a-qianse_tubiao_yichangbaocuo1`) |
99
+ | `color` | String | `''` | 自定义颜色覆盖 (hex, rgb 等) |
100
+ | `size` | String/Number | `''` | 字体大小。纯数字会被视为 `px` 单位。 |
101
+ | `isRed` | Boolean | `false` | 设置图标为红色 (`#f56c6c`)。 |
102
+ | `disabled` | Boolean | `false` | 设置图标为灰色 (`#C0C4CC`) 并将鼠标样式设为禁止。 |
104
103
 
105
104
  ## 构建与发布
106
105
 
107
106
  1. 构建库 (生成 JS 和 类型定义文件):
107
+
108
108
  ```bash
109
109
  npm run build
110
110
  ```
111
-
112
111
  2. 发布到 npm:
112
+
113
113
  ```bash
114
114
  npm publish
115
115
  ```
@@ -1,4 +1,4 @@
1
- import { defineComponent as r, inject as c, computed as f, createElementBlock as s, openBlock as a, mergeProps as i } from "vue";
1
+ import { defineComponent as r, inject as c, computed as a, createElementBlock as f, openBlock as i, mergeProps as s } from "vue";
2
2
  const d = r({
3
3
  name: "MvIconfront",
4
4
  props: {
@@ -31,34 +31,34 @@ const d = r({
31
31
  setup(e) {
32
32
  const o = c("mvIconfrontDefaultColor", "#FFFFFF");
33
33
  return {
34
- iconStyle: f(() => {
34
+ iconStyle: a(() => {
35
35
  const t = {};
36
- if (e.disabled ? t.color = "#C0C4CC" : e.isRed ? t.color = "#f56c6c" : e.color ? t.color = e.color : t.color = o, e.size) {
37
- const l = e.size.toString();
38
- t.fontSize = l.endsWith("px") || l.endsWith("rem") ? l : `${l}px`;
36
+ if (e.disabled ? t.color = "#C0C4CC !important" : e.isRed ? t.color = "#f56c6c !important" : e.color ? t.color = `${e.color} !important` : t.color = `${o} !important`, e.size) {
37
+ const n = e.size.toString();
38
+ t.fontSize = n.endsWith("px") || n.endsWith("rem") ? n : `${n}px`;
39
39
  }
40
40
  return t;
41
41
  })
42
42
  };
43
43
  }
44
44
  }), u = (e, o) => {
45
- const n = e.__vccOpts || e;
46
- for (const [t, l] of o)
47
- n[t] = l;
48
- return n;
45
+ const l = e.__vccOpts || e;
46
+ for (const [t, n] of o)
47
+ l[t] = n;
48
+ return l;
49
49
  };
50
- function m(e, o, n, t, l, g) {
51
- return a(), s("i", i({
50
+ function m(e, o, l, t, n, g) {
51
+ return i(), f("i", s({
52
52
  class: ["icon2", e.name, { "is-disabled": e.disabled }],
53
53
  style: e.iconStyle
54
54
  }, e.$attrs), null, 16);
55
55
  }
56
56
  const C = /* @__PURE__ */ u(d, [["render", m]]), y = (e, o) => {
57
57
  o != null && o.defaultColor && (e.config.globalProperties.$mvIconfrontDefaultColor = o.defaultColor, e.provide("mvIconfrontDefaultColor", o.defaultColor)), e.component("MvIconfront", C);
58
- }, S = {
58
+ }, v = {
59
59
  install: y
60
60
  };
61
61
  export {
62
62
  C as MvIconfront,
63
- S as default
63
+ v as default
64
64
  };
@@ -1 +1 @@
1
- (function(l,o){typeof exports=="object"&&typeof module<"u"?o(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],o):(l=typeof globalThis<"u"?globalThis:l||self,o(l.MvIconfront={},l.Vue))})(this,function(l,o){"use strict";const i=o.defineComponent({name:"MvIconfront",props:{name:{type:String,default:""},color:{type:String,default:""},size:{type:[String,Number],default:""},isRed:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1}},setup(e){const t=o.inject("mvIconfrontDefaultColor","#FFFFFF");return{iconStyle:o.computed(()=>{const n={};if(e.disabled?n.color="#C0C4CC":e.isRed?n.color="#f56c6c":e.color?n.color=e.color:n.color=t,e.size){const r=e.size.toString();n.fontSize=r.endsWith("px")||r.endsWith("rem")?r:`${r}px`}return n})}}}),s=(e,t)=>{const f=e.__vccOpts||e;for(const[n,r]of t)f[n]=r;return f};function d(e,t,f,n,r,m){return o.openBlock(),o.createElementBlock("i",o.mergeProps({class:["icon2",e.name,{"is-disabled":e.disabled}],style:e.iconStyle},e.$attrs),null,16)}const c=s(i,[["render",d]]),a={install:(e,t)=>{t!=null&&t.defaultColor&&(e.config.globalProperties.$mvIconfrontDefaultColor=t.defaultColor,e.provide("mvIconfrontDefaultColor",t.defaultColor)),e.component("MvIconfront",c)}};l.MvIconfront=c,l.default=a,Object.defineProperties(l,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
1
+ (function(l,t){typeof exports=="object"&&typeof module<"u"?t(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],t):(l=typeof globalThis<"u"?globalThis:l||self,t(l.MvIconfront={},l.Vue))})(this,function(l,t){"use strict";const c=t.defineComponent({name:"MvIconfront",props:{name:{type:String,default:""},color:{type:String,default:""},size:{type:[String,Number],default:""},isRed:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1}},setup(e){const o=t.inject("mvIconfrontDefaultColor","#FFFFFF");return{iconStyle:t.computed(()=>{const n={};if(e.disabled?n.color="#C0C4CC !important":e.isRed?n.color="#f56c6c !important":e.color?n.color=`${e.color} !important`:n.color=`${o} !important`,e.size){const r=e.size.toString();n.fontSize=r.endsWith("px")||r.endsWith("rem")?r:`${r}px`}return n})}}}),s=(e,o)=>{const i=e.__vccOpts||e;for(const[n,r]of o)i[n]=r;return i};function a(e,o,i,n,r,m){return t.openBlock(),t.createElementBlock("i",t.mergeProps({class:["icon2",e.name,{"is-disabled":e.disabled}],style:e.iconStyle},e.$attrs),null,16)}const f=s(c,[["render",a]]),d={install:(e,o)=>{o!=null&&o.defaultColor&&(e.config.globalProperties.$mvIconfrontDefaultColor=o.defaultColor,e.provide("mvIconfrontDefaultColor",o.defaultColor)),e.component("MvIconfront",f)}};l.MvIconfront=f,l.default=d,Object.defineProperties(l,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mv-iconfront",
3
- "version": "1.0.6",
3
+ "version": "1.0.7",
4
4
  "description": "A customized icon component for Vue 3",
5
5
  "main": "dist/mv-iconfront.umd.js",
6
6
  "module": "dist/mv-iconfront.es.js",