morghulis 2.0.48 → 2.0.51

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.
@@ -1 +1 @@
1
- .m-button[data-v-1d04af69]{display:inline-flex;justify-content:center;align-items:center;line-height:1;height:32px;white-space:nowrap;cursor:pointer;color:#606266;text-align:center;box-sizing:border-box;outline:none;transition:.1s;font-weight:500;-webkit-user-select:none;user-select:none;vertical-align:middle;-webkit-appearance:none;background-color:#fff;border:1px solid #dcdfe6;padding:8px 15px;font-size:14px;border-radius:4px}.m-button[data-v-1d04af69]:hover{color:#409eff;border-color:#c6e2ff;background-color:#ecf5ff}.m-button[data-v-1d04af69]:active{color:#3a8ee6;border-color:#3a8ee6;outline:none}.m-button--primary[data-v-1d04af69]{color:#fff;background-color:#409eff;border-color:#409eff}.m-button--primary[data-v-1d04af69]:hover{background:#66b1ff;border-color:#66b1ff;color:#fff}.m-button--primary[data-v-1d04af69]:active{background:#3a8ee6;border-color:#3a8ee6;color:#fff}.m-button--success[data-v-1d04af69]{color:#fff;background-color:#67c23a;border-color:#67c23a}.m-button--success[data-v-1d04af69]:hover{background:#85ce61;border-color:#85ce61;color:#fff}.m-button--success[data-v-1d04af69]:active{background:#5daf34;border-color:#5daf34;color:#fff}.m-button--warning[data-v-1d04af69]{color:#fff;background-color:#e6a23c;border-color:#e6a23c}.m-button--warning[data-v-1d04af69]:hover{background:#ebb563;border-color:#ebb563;color:#fff}.m-button--warning[data-v-1d04af69]:active{background:#cf9236;border-color:#cf9236;color:#fff}.m-button--danger[data-v-1d04af69]{color:#fff;background-color:#f56c6c;border-color:#f56c6c}.m-button--danger[data-v-1d04af69]:hover{background:#f78989;border-color:#f78989;color:#fff}.m-button--danger[data-v-1d04af69]:active{background:#dd6161;border-color:#dd6161;color:#fff}.m-button--info[data-v-1d04af69]{color:#fff;background-color:#909399;border-color:#909399}.m-button--info[data-v-1d04af69]:hover{background:#a6a9ad;border-color:#a6a9ad;color:#fff}.m-button--info[data-v-1d04af69]:active{background:#82848a;border-color:#82848a;color:#fff}.m-button--small[data-v-1d04af69]{height:24px;padding:5px 11px;font-size:12px;border-radius:3px}.m-button--large[data-v-1d04af69]{height:40px;padding:12px 19px;font-size:16px;border-radius:4px}.m-button--round[data-v-1d04af69]{border-radius:20px}.m-button--plain[data-v-1d04af69]{background:transparent}.m-button--plain.m-button--primary[data-v-1d04af69]{color:#409eff}.m-button--plain.m-button--success[data-v-1d04af69]{color:#67c23a}.m-button--plain.m-button--warning[data-v-1d04af69]{color:#e6a23c}.m-button--plain.m-button--danger[data-v-1d04af69]{color:#f56c6c}.m-button--plain.m-button--info[data-v-1d04af69]{color:#909399}.m-button--disabled[data-v-1d04af69],.m-button--disabled[data-v-1d04af69]:hover,.m-button--disabled[data-v-1d04af69]:focus,.m-button--disabled[data-v-1d04af69]:active{color:#c0c4cc;cursor:not-allowed;background-image:none;background-color:#fff;border-color:#ebeef5}.m-button--disabled.m-button--primary[data-v-1d04af69],.m-button--disabled.m-button--success[data-v-1d04af69],.m-button--disabled.m-button--warning[data-v-1d04af69],.m-button--disabled.m-button--danger[data-v-1d04af69],.m-button--disabled.m-button--info[data-v-1d04af69]{color:#fff;background-color:#a0cfff;border-color:#a0cfff;opacity:.6}.m-button__loading[data-v-1d04af69]{display:inline-flex;align-items:center;margin-right:5px}.m-button__loading-icon[data-v-1d04af69]{animation:rotating-1d04af69 2s linear infinite}.m-button__icon[data-v-1d04af69]{margin-right:5px}.m-button__icon+.m-button__text[data-v-1d04af69]{margin-left:5px}@keyframes rotating-1d04af69{0%{transform:rotate(0)}to{transform:rotate(360deg)}}
1
+ .m-button{display:inline-flex;justify-content:center;align-items:center;line-height:1;height:32px;white-space:nowrap;cursor:pointer;color:#606266;text-align:center;box-sizing:border-box;outline:none;transition:.1s;font-weight:500;-webkit-user-select:none;user-select:none;vertical-align:middle;-webkit-appearance:none;background-color:#fff;border:1px solid #dcdfe6;padding:8px 15px;font-size:14px;border-radius:4px}.m-button:hover{color:#409eff;border-color:#c6e2ff;background-color:#ecf5ff}.m-button:active{color:#3a8ee6;border-color:#3a8ee6;outline:none}.m-button--primary{color:#fff;background-color:#409eff;border-color:#409eff}.m-button--primary:hover{background:#66b1ff;border-color:#66b1ff;color:#fff}.m-button--primary:active{background:#3a8ee6;border-color:#3a8ee6;color:#fff}.m-button--success{color:#fff;background-color:#67c23a;border-color:#67c23a}.m-button--success:hover{background:#85ce61;border-color:#85ce61;color:#fff}.m-button--success:active{background:#5daf34;border-color:#5daf34;color:#fff}.m-button--warning{color:#fff;background-color:#e6a23c;border-color:#e6a23c}.m-button--warning:hover{background:#ebb563;border-color:#ebb563;color:#fff}.m-button--warning:active{background:#cf9236;border-color:#cf9236;color:#fff}.m-button--danger{color:#fff;background-color:#f56c6c;border-color:#f56c6c}.m-button--danger:hover{background:#f78989;border-color:#f78989;color:#fff}.m-button--danger:active{background:#dd6161;border-color:#dd6161;color:#fff}.m-button--info{color:#fff;background-color:#909399;border-color:#909399}.m-button--info:hover{background:#a6a9ad;border-color:#a6a9ad;color:#fff}.m-button--info:active{background:#82848a;border-color:#82848a;color:#fff}.m-button--small{height:24px;padding:5px 11px;font-size:12px;border-radius:3px}.m-button--large{height:40px;padding:12px 19px;font-size:16px;border-radius:4px}.m-button--round{border-radius:20px}.m-button--circle{border-radius:50%;padding:8px}.m-button--plain{background:transparent}.m-button--plain.m-button--primary{color:#409eff}.m-button--plain.m-button--success{color:#67c23a}.m-button--plain.m-button--warning{color:#e6a23c}.m-button--plain.m-button--danger{color:#f56c6c}.m-button--plain.m-button--info{color:#909399}.m-button--disabled,.m-button--disabled:hover,.m-button--disabled:focus,.m-button--disabled:active{color:#c0c4cc;cursor:not-allowed;background-image:none;background-color:#fff;border-color:#ebeef5}.m-button--disabled.m-button--primary,.m-button--disabled.m-button--success,.m-button--disabled.m-button--warning,.m-button--disabled.m-button--danger,.m-button--disabled.m-button--info{color:#fff;background-color:#a0cfff;border-color:#a0cfff;opacity:.6}.m-button__loading{display:inline-flex;align-items:center;margin-right:5px}.m-button__loading-icon{animation:rotating 2s linear infinite}.m-button__icon{margin-right:5px}.m-button__icon+.m-button__text{margin-left:5px}@keyframes rotating{0%{transform:rotate(0)}to{transform:rotate(360deg)}}
@@ -1,158 +1,126 @@
1
- import { defineComponent as m, computed as b, createElementBlock as a, openBlock as s, normalizeClass as r, createCommentVNode as u, createElementVNode as i, renderSlot as g, createTextVNode as p, toDisplayString as k } from "vue";
2
- const y = m({
3
- name: "MButton",
4
- props: {
5
- /**
6
- * 按钮类型
7
- * @values default, primary, success, warning, danger, info
8
- */
9
- type: {
10
- type: String,
11
- default: "default"
12
- },
13
- /**
14
- * 按钮尺寸
15
- * @values small, medium, large
16
- */
17
- size: {
18
- type: String,
19
- default: "medium"
20
- },
21
- /**
22
- * 是否为圆角按钮
23
- */
24
- round: {
25
- type: Boolean,
26
- default: !1
27
- },
28
- /**
29
- * 是否为朴素按钮
30
- */
31
- plain: {
32
- type: Boolean,
33
- default: !1
34
- },
35
- /**
36
- * 是否禁用按钮
37
- */
38
- disabled: {
39
- type: Boolean,
40
- default: !1
41
- },
42
- /**
43
- * 按钮文本
44
- */
45
- text: {
46
- type: String,
47
- default: void 0
48
- },
49
- /**
50
- * 是否显示加载状态
51
- */
52
- loading: {
53
- type: Boolean,
54
- default: !1
55
- },
56
- /**
57
- * 按钮图标类名
58
- */
59
- icon: {
60
- type: String,
61
- default: void 0
62
- }
1
+ import { defineComponent as u, computed as c, createVNode as n } from "vue";
2
+ const s = {
3
+ /**
4
+ * 按钮类型
5
+ * @values default, primary, success, warning, danger, info, text
6
+ */
7
+ type: {
8
+ type: String,
9
+ default: "default"
10
+ },
11
+ /**
12
+ * 按钮尺寸
13
+ * @values large, default, small
14
+ */
15
+ size: {
16
+ type: String,
17
+ default: "default"
18
+ },
19
+ /**
20
+ * 是否为朴素按钮
21
+ */
22
+ plain: {
23
+ type: Boolean,
24
+ default: !1
25
+ },
26
+ /**
27
+ * 是否为圆角按钮
28
+ */
29
+ round: {
30
+ type: Boolean,
31
+ default: !1
32
+ },
33
+ /**
34
+ * 是否为圆形按钮
35
+ */
36
+ circle: {
37
+ type: Boolean,
38
+ default: !1
63
39
  },
40
+ /**
41
+ * 是否禁用按钮
42
+ */
43
+ disabled: {
44
+ type: Boolean,
45
+ default: !1
46
+ },
47
+ /**
48
+ * 是否显示加载状态
49
+ */
50
+ loading: {
51
+ type: Boolean,
52
+ default: !1
53
+ },
54
+ /**
55
+ * 按钮图标类名
56
+ */
57
+ icon: {
58
+ type: String,
59
+ default: ""
60
+ },
61
+ /**
62
+ * 按钮文本
63
+ */
64
+ text: {
65
+ type: String,
66
+ default: ""
67
+ }
68
+ }, a = /* @__PURE__ */ u({
69
+ name: "MButton",
70
+ props: s,
64
71
  emits: ["click"],
65
- setup(t, { emit: e, expose: n }) {
66
- const o = b(() => [
67
- "m-button",
68
- `m-button--${t.type}`,
69
- `m-button--${t.size}`,
70
- {
71
- "m-button--round": t.round,
72
- "m-button--plain": t.plain,
73
- "m-button--disabled": t.disabled,
74
- "m-button--loading": t.loading
75
- }
76
- ]), l = (c) => {
77
- t.disabled || t.loading || e("click", c);
78
- };
79
- return n({
80
- /**
81
- * 触发按钮点击事件
82
- */
83
- triggerClick: () => {
84
- !t.disabled && !t.loading && e("click", new MouseEvent("click"));
85
- }
86
- }), {
87
- buttonClass: o,
88
- handleClick: l
72
+ setup(t, {
73
+ slots: l,
74
+ emit: o
75
+ }) {
76
+ const i = c(() => ["m-button", `m-button--${t.type}`, `m-button--${t.size}`, {
77
+ "m-button--round": t.round,
78
+ "m-button--plain": t.plain,
79
+ "m-button--circle": t.circle,
80
+ "m-button--disabled": t.disabled,
81
+ "m-button--loading": t.loading
82
+ }]), d = (e) => {
83
+ t.disabled || t.loading || o("click", e);
89
84
  };
90
- }
91
- }), _ = (t, e) => {
92
- const n = t.__vccOpts || t;
93
- for (const [o, l] of e)
94
- n[o] = l;
95
- return n;
96
- }, B = ["disabled"], C = {
97
- key: 0,
98
- class: "m-button__loading"
99
- }, h = {
100
- key: 1,
101
- class: "m-button__icon"
102
- }, v = {
103
- key: 2,
104
- class: "m-button__text"
105
- };
106
- function $(t, e, n, o, l, c) {
107
- return s(), a("button", {
108
- class: r(t.buttonClass),
109
- disabled: t.disabled,
110
- onClick: e[0] || (e[0] = (...f) => t.handleClick && t.handleClick(...f))
111
- }, [
112
- t.loading ? (s(), a("span", C, e[1] || (e[1] = [
113
- i("svg", {
85
+ return () => {
86
+ var e;
87
+ return n("button", {
88
+ class: i.value,
89
+ disabled: t.disabled,
90
+ onClick: d
91
+ }, [t.loading && n("span", {
92
+ class: "m-button__loading"
93
+ }, [n("svg", {
114
94
  class: "m-button__loading-icon",
115
95
  viewBox: "0 0 1024 1024",
116
96
  xmlns: "http://www.w3.org/2000/svg",
117
97
  width: "16",
118
98
  height: "16"
119
- }, [
120
- i("path", {
121
- d: "M512 64c-247.42 0-448 200.58-448 448s200.58 448 448 448 448-200.58 448-448-200.58-448-448-448zm0 820c-205.4 0-372-166.6-372-372s166.6-372 372-372 372 166.6 372 372-166.6 372-372 372z",
122
- fill: "#e6e6e6"
123
- }),
124
- i("path", {
125
- d: "M512 140c-205.4 0-372 166.6-372 372s166.6 372 372 372V140z",
126
- fill: "currentColor"
127
- })
128
- ], -1)
129
- ]))) : u("", !0),
130
- t.icon && !t.loading ? (s(), a("span", h, [
131
- i("i", {
132
- class: r(t.icon)
133
- }, null, 2)
134
- ])) : u("", !0),
135
- t.$slots.default || t.text ? (s(), a("span", v, [
136
- g(t.$slots, "default", {}, () => [
137
- p(k(t.text), 1)
138
- ], !0)
139
- ])) : u("", !0)
140
- ], 10, B);
141
- }
142
- const d = /* @__PURE__ */ _(y, [["render", $], ["__scopeId", "data-v-1d04af69"]]), w = (t) => {
143
- t.component("MButton", d);
144
- };
145
- d.install = (t) => {
146
- t.component("MButton", d);
147
- };
148
- const M = (t) => {
149
- w(t);
150
- }, S = {
151
- install: M,
152
- MButton: d
99
+ }, [n("path", {
100
+ d: "M512 64c-247.42 0-448 200.58-448 448s200.58 448 448 448 448-200.58 448-448-200.58-448-448-448zm0 820c-205.4 0-372-166.6-372-372s166.6-372 372-372 372 166.6 372 372-166.6 372-372 372z",
101
+ fill: "#e6e6e6"
102
+ }, null), n("path", {
103
+ d: "M512 140c-205.4 0-372 166.6-372 372s166.6 372 372 372V140z",
104
+ fill: "currentColor"
105
+ }, null)])]), t.icon && !t.loading && n("span", {
106
+ class: "m-button__icon"
107
+ }, [n("i", {
108
+ class: t.icon
109
+ }, null)]), n("span", {
110
+ class: "m-button__text"
111
+ }, [((e = l.default) == null ? void 0 : e.call(l)) || t.text])]);
112
+ };
113
+ }
114
+ }), f = (t) => {
115
+ t.component("MButton", a);
116
+ }, b = (t) => {
117
+ f(t);
118
+ }, g = {
119
+ install: b,
120
+ MButton: a
153
121
  };
154
122
  export {
155
- d as MButton,
156
- S as default,
157
- M as install
123
+ a as MButton,
124
+ g as default,
125
+ b as install
158
126
  };
package/index.d.ts CHANGED
@@ -1,22 +1,24 @@
1
- import type { App, Component } from 'vue';
1
+ import type { DefineComponent } from 'vue';
2
2
 
3
3
  // 按钮类型
4
- export declare type ButtonType = 'default' | 'primary' | 'success' | 'warning' | 'danger' | 'info' | 'text';
4
+ export type ButtonType = 'default' | 'primary' | 'success' | 'warning' | 'danger' | 'info' | 'text';
5
5
 
6
6
  // 按钮尺寸
7
- export declare type ButtonSize = 'large' | 'default' | 'small';
7
+ export type ButtonSize = 'large' | 'default' | 'small';
8
8
 
9
- // 按钮属性
10
- export interface ButtonProps {
9
+ // 按钮属性定义
10
+ export interface MButtonProps {
11
11
  /**
12
12
  * 按钮类型
13
- * @default 'default'
13
+ * @values default, primary, success, warning, danger, info, text
14
+ * @default default
14
15
  */
15
16
  type?: ButtonType;
16
17
 
17
18
  /**
18
19
  * 按钮尺寸
19
- * @default 'default'
20
+ * @values large, default, small
21
+ * @default default
20
22
  */
21
23
  size?: ButtonSize;
22
24
 
@@ -54,34 +56,18 @@ export interface ButtonProps {
54
56
  * 按钮图标类名
55
57
  */
56
58
  icon?: string;
57
- }
58
-
59
- // 按钮事件
60
- export interface ButtonEvents {
61
- /**
62
- * 点击按钮时触发
63
- * @param event 鼠标事件对象
64
- */
65
- click: (event: MouseEvent) => void;
66
- }
67
-
68
- // 按钮实例
69
- export interface ButtonInstance {
70
- $props: ButtonProps;
71
59
 
72
60
  /**
73
- * 触发按钮点击事件
61
+ * 按钮文本
74
62
  */
75
- triggerClick: () => void;
63
+ text?: string;
76
64
  }
77
65
 
78
- // MButton组件
79
- export declare const MButton: Component & {
80
- install(app: App): void;
81
- };
66
+ // 按钮组件
67
+ export declare const MButton: DefineComponent<MButtonProps>;
82
68
 
83
- // 全局安装函数
84
- export declare function install(app: App): void;
69
+ // 安装函数
70
+ export declare function install(app: any): void;
85
71
 
86
72
  // 默认导出
87
73
  declare const _default: {
@@ -91,9 +77,9 @@ declare const _default: {
91
77
 
92
78
  export default _default;
93
79
 
94
- // 为全局组件扩展类型
95
- declare module '@vue/runtime-core' {
96
- export interface GlobalComponents {
80
+ // 自定义Vue类型扩展
81
+ declare module 'vue' {
82
+ interface GlobalComponents {
97
83
  MButton: typeof MButton;
98
84
  }
99
85
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "morghulis",
3
- "version": "2.0.48",
3
+ "version": "2.0.51",
4
4
  "description": "一个Vue 3按钮组件库,支持TypeScript和IDE自动补全",
5
5
  "type": "module",
6
6
  "main": "dist/morghulis.es.js",
@@ -8,7 +8,12 @@
8
8
  "types": "index.d.ts",
9
9
  "exports": {
10
10
  ".": {
11
- "types": ["./index.d.ts", "./global.d.ts", "./volar.d.ts", "./components.d.ts"],
11
+ "types": [
12
+ "./index.d.ts",
13
+ "./typings/components.d.ts",
14
+ "./typings/volar.d.ts",
15
+ "./typings/jetbrains.d.ts"
16
+ ],
12
17
  "import": "./dist/morghulis.es.js",
13
18
  "require": "./dist/morghulis.es.js"
14
19
  },
@@ -17,13 +22,11 @@
17
22
  "files": [
18
23
  "dist",
19
24
  "index.d.ts",
20
- "global.d.ts",
21
- "volar.d.ts",
22
- "components.d.ts"
25
+ "typings"
23
26
  ],
24
27
  "scripts": {
25
28
  "dev": "vite",
26
- "build": "run-p type-check build-only generate-types",
29
+ "build": "npm run build-only",
27
30
  "preview": "vite preview",
28
31
  "build-only": "vite build",
29
32
  "type-check": "vue-tsc --build",
@@ -41,12 +44,14 @@
41
44
  "author": "",
42
45
  "license": "MIT",
43
46
  "dependencies": {
44
- "vue": "^3.5.13"
47
+ "vue": "^3.0.0"
45
48
  },
46
49
  "devDependencies": {
47
50
  "@tsconfig/node22": "^22.0.1",
48
51
  "@types/node": "^22.14.0",
52
+ "@types/vue": "^1.0.31",
49
53
  "@vitejs/plugin-vue": "^5.2.3",
54
+ "@vitejs/plugin-vue-jsx": "^4.1.2",
50
55
  "@vue/tsconfig": "^0.7.0",
51
56
  "npm-run-all2": "^7.0.2",
52
57
  "typescript": "~5.8.0",
@@ -0,0 +1,66 @@
1
+ // 为全局组件提供自动补全
2
+ declare module 'vue' {
3
+ export interface GlobalComponents {
4
+ MButton: {
5
+ /**
6
+ * 按钮类型
7
+ * @default 'default'
8
+ * @values default, primary, success, warning, danger, info, text
9
+ */
10
+ type?: 'default' | 'primary' | 'success' | 'warning' | 'danger' | 'info' | 'text'
11
+
12
+ /**
13
+ * 按钮尺寸
14
+ * @default 'default'
15
+ * @values large, default, small
16
+ */
17
+ size?: 'large' | 'default' | 'small'
18
+
19
+ /**
20
+ * 是否为朴素按钮
21
+ * @default false
22
+ */
23
+ plain?: boolean
24
+
25
+ /**
26
+ * 是否为圆角按钮
27
+ * @default false
28
+ */
29
+ round?: boolean
30
+
31
+ /**
32
+ * 是否为圆形按钮
33
+ * @default false
34
+ */
35
+ circle?: boolean
36
+
37
+ /**
38
+ * 是否禁用按钮
39
+ * @default false
40
+ */
41
+ disabled?: boolean
42
+
43
+ /**
44
+ * 是否显示加载状态
45
+ * @default false
46
+ */
47
+ loading?: boolean
48
+
49
+ /**
50
+ * 按钮图标类名
51
+ */
52
+ icon?: string
53
+
54
+ /**
55
+ * 按钮文本
56
+ */
57
+ text?: string
58
+
59
+ /**
60
+ * 点击事件
61
+ * @param event 鼠标事件
62
+ */
63
+ onClick?: (event: MouseEvent) => void
64
+ }
65
+ }
66
+ }
@@ -0,0 +1,134 @@
1
+ // JetBrains IDE (PyCharm/WebStorm)专用类型声明
2
+
3
+ declare module 'morghulis' {
4
+ import { DefineComponent } from 'vue';
5
+
6
+ export type ButtonType = 'default' | 'primary' | 'success' | 'warning' | 'danger' | 'info' | 'text';
7
+ export type ButtonSize = 'large' | 'default' | 'small';
8
+
9
+ export interface MButtonProps {
10
+ /**
11
+ * 按钮类型
12
+ * @values default, primary, success, warning, danger, info, text
13
+ * @default default
14
+ */
15
+ type?: ButtonType;
16
+
17
+ /**
18
+ * 按钮尺寸
19
+ * @values large, default, small
20
+ * @default default
21
+ */
22
+ size?: ButtonSize;
23
+
24
+ /**
25
+ * 是否为朴素按钮
26
+ * @default false
27
+ */
28
+ plain?: boolean;
29
+
30
+ /**
31
+ * 是否为圆角按钮
32
+ * @default false
33
+ */
34
+ round?: boolean;
35
+
36
+ /**
37
+ * 是否为圆形按钮
38
+ * @default false
39
+ */
40
+ circle?: boolean;
41
+
42
+ /**
43
+ * 是否禁用按钮
44
+ * @default false
45
+ */
46
+ disabled?: boolean;
47
+
48
+ /**
49
+ * 是否显示加载状态
50
+ * @default false
51
+ */
52
+ loading?: boolean;
53
+
54
+ /**
55
+ * 按钮图标类名
56
+ */
57
+ icon?: string;
58
+
59
+ /**
60
+ * 按钮文本
61
+ */
62
+ text?: string;
63
+ }
64
+
65
+ export const MButton: DefineComponent<MButtonProps>;
66
+ }
67
+
68
+ /**
69
+ * 扩展Vue JSX类型
70
+ */
71
+ declare namespace JSX {
72
+ interface IntrinsicElements {
73
+ MButton: {
74
+ /**
75
+ * 按钮类型
76
+ * @values default, primary, success, warning, danger, info, text
77
+ * @default default
78
+ */
79
+ type?: 'default' | 'primary' | 'success' | 'warning' | 'danger' | 'info' | 'text';
80
+
81
+ /**
82
+ * 按钮尺寸
83
+ * @values large, default, small
84
+ * @default default
85
+ */
86
+ size?: 'large' | 'default' | 'small';
87
+
88
+ /**
89
+ * 是否为朴素按钮
90
+ * @default false
91
+ */
92
+ plain?: boolean;
93
+
94
+ /**
95
+ * 是否为圆角按钮
96
+ * @default false
97
+ */
98
+ round?: boolean;
99
+
100
+ /**
101
+ * 是否为圆形按钮
102
+ * @default false
103
+ */
104
+ circle?: boolean;
105
+
106
+ /**
107
+ * 是否禁用按钮
108
+ * @default false
109
+ */
110
+ disabled?: boolean;
111
+
112
+ /**
113
+ * 是否显示加载状态
114
+ * @default false
115
+ */
116
+ loading?: boolean;
117
+
118
+ /**
119
+ * 按钮图标类名
120
+ */
121
+ icon?: string;
122
+
123
+ /**
124
+ * 按钮文本
125
+ */
126
+ text?: string;
127
+
128
+ /**
129
+ * 点击事件
130
+ */
131
+ onClick?: (event: MouseEvent) => void;
132
+ }
133
+ }
134
+ }
@@ -0,0 +1,73 @@
1
+ // Volar 专用类型声明
2
+ // https://github.com/johnsoncodehk/volar/tree/master/extensions/vscode-vue-language-features
3
+
4
+ declare module 'vue' {
5
+ export interface GlobalComponents {
6
+ /**
7
+ * 按钮组件
8
+ */
9
+ MButton: {
10
+ $props: {
11
+ /**
12
+ * 按钮类型
13
+ * @default 'default'
14
+ */
15
+ type?: 'default' | 'primary' | 'success' | 'warning' | 'danger' | 'info' | 'text'
16
+
17
+ /**
18
+ * 按钮尺寸
19
+ * @default 'default'
20
+ */
21
+ size?: 'large' | 'default' | 'small'
22
+
23
+ /**
24
+ * 是否为朴素按钮
25
+ * @default false
26
+ */
27
+ plain?: boolean
28
+
29
+ /**
30
+ * 是否为圆角按钮
31
+ * @default false
32
+ */
33
+ round?: boolean
34
+
35
+ /**
36
+ * 是否为圆形按钮
37
+ * @default false
38
+ */
39
+ circle?: boolean
40
+
41
+ /**
42
+ * 是否禁用按钮
43
+ * @default false
44
+ */
45
+ disabled?: boolean
46
+
47
+ /**
48
+ * 是否显示加载状态
49
+ * @default false
50
+ */
51
+ loading?: boolean
52
+
53
+ /**
54
+ * 按钮图标类名
55
+ */
56
+ icon?: string
57
+
58
+ /**
59
+ * 按钮文本
60
+ */
61
+ text?: string
62
+ }
63
+
64
+ $slots: {
65
+ default: () => any
66
+ }
67
+
68
+ $emit: {
69
+ click: (event: MouseEvent) => void
70
+ }
71
+ }
72
+ }
73
+ }
package/components.d.ts DELETED
@@ -1,15 +0,0 @@
1
- // 自动生成的组件声明文件
2
- declare module '@vue/runtime-core' {
3
- export interface GlobalComponents {
4
- MButton: {
5
- type?: 'default' | 'primary' | 'success' | 'warning' | 'danger' | 'info' | 'text'
6
- size?: 'large' | 'default' | 'small'
7
- plain?: boolean
8
- round?: boolean
9
- circle?: boolean
10
- disabled?: boolean
11
- loading?: boolean
12
- icon?: string
13
- }
14
- }
15
- }
package/global.d.ts DELETED
@@ -1,107 +0,0 @@
1
- import { DefineComponent } from 'vue'
2
-
3
- declare module 'morghulis' {
4
- export interface MButtonProps {
5
- /**
6
- * 按钮类型
7
- * @default 'default'
8
- */
9
- type?: 'default' | 'primary' | 'success' | 'warning' | 'danger' | 'info' | 'text'
10
-
11
- /**
12
- * 按钮尺寸
13
- * @default 'default'
14
- */
15
- size?: 'large' | 'default' | 'small'
16
-
17
- /**
18
- * 是否为朴素按钮
19
- * @default false
20
- */
21
- plain?: boolean
22
-
23
- /**
24
- * 是否为圆角按钮
25
- * @default false
26
- */
27
- round?: boolean
28
-
29
- /**
30
- * 是否为圆形按钮
31
- * @default false
32
- */
33
- circle?: boolean
34
-
35
- /**
36
- * 是否禁用按钮
37
- * @default false
38
- */
39
- disabled?: boolean
40
-
41
- /**
42
- * 是否显示加载状态
43
- * @default false
44
- */
45
- loading?: boolean
46
-
47
- /**
48
- * 按钮图标类名
49
- */
50
- icon?: string
51
- }
52
-
53
- export const MButton: DefineComponent<MButtonProps>
54
- }
55
-
56
- declare module '@vue/runtime-core' {
57
- interface GlobalComponents {
58
- MButton: DefineComponent<{
59
- /**
60
- * 按钮类型
61
- * @default 'default'
62
- */
63
- type?: 'default' | 'primary' | 'success' | 'warning' | 'danger' | 'info' | 'text'
64
-
65
- /**
66
- * 按钮尺寸
67
- * @default 'default'
68
- */
69
- size?: 'large' | 'default' | 'small'
70
-
71
- /**
72
- * 是否为朴素按钮
73
- * @default false
74
- */
75
- plain?: boolean
76
-
77
- /**
78
- * 是否为圆角按钮
79
- * @default false
80
- */
81
- round?: boolean
82
-
83
- /**
84
- * 是否为圆形按钮
85
- * @default false
86
- */
87
- circle?: boolean
88
-
89
- /**
90
- * 是否禁用按钮
91
- * @default false
92
- */
93
- disabled?: boolean
94
-
95
- /**
96
- * 是否显示加载状态
97
- * @default false
98
- */
99
- loading?: boolean
100
-
101
- /**
102
- * 按钮图标类名
103
- */
104
- icon?: string
105
- }>
106
- }
107
- }
package/volar.d.ts DELETED
@@ -1,14 +0,0 @@
1
- declare module 'vue' {
2
- export interface GlobalComponents {
3
- MButton: {
4
- type?: 'default' | 'primary' | 'success' | 'warning' | 'danger' | 'info' | 'text'
5
- size?: 'large' | 'default' | 'small'
6
- plain?: boolean
7
- round?: boolean
8
- circle?: boolean
9
- disabled?: boolean
10
- loading?: boolean
11
- icon?: string
12
- }
13
- }
14
- }