pacvue-el-components 1.0.0
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 +150 -0
- package/dist/components/button/index.vue.d.ts +67 -0
- package/dist/components/button/types.d.ts +4 -0
- package/dist/components/select/index.vue.d.ts +451 -0
- package/dist/components/select/types.d.ts +4 -0
- package/dist/index.d.ts +1016 -0
- package/dist/pacvue.es.js +198 -0
- package/dist/pacvue.es.js.map +1 -0
- package/dist/pacvue.umd.js +2 -0
- package/dist/pacvue.umd.js.map +1 -0
- package/dist/style.css +0 -0
- package/package.json +73 -0
- package/src/components/button/index.vue +54 -0
- package/src/components/button/types.ts +7 -0
- package/src/components/select/index.vue +118 -0
- package/src/components/select/types.ts +7 -0
- package/src/index.ts +29 -0
- package/src/style.css +3 -0
- package/src/vite-env.d.ts +8 -0
|
@@ -0,0 +1,198 @@
|
|
|
1
|
+
import { defineComponent as f, resolveComponent as s, createBlock as r, openBlock as m, mergeProps as p, withCtx as y, renderSlot as g, mergeModels as c, useModel as C } from "vue";
|
|
2
|
+
const V = /* @__PURE__ */ f({
|
|
3
|
+
name: "PacvueElButton",
|
|
4
|
+
__name: "index",
|
|
5
|
+
props: {
|
|
6
|
+
size: { default: "default" },
|
|
7
|
+
disabled: { type: Boolean, default: !1 },
|
|
8
|
+
type: { default: "default" },
|
|
9
|
+
icon: {},
|
|
10
|
+
nativeType: { default: "button" },
|
|
11
|
+
loading: { type: Boolean, default: !1 },
|
|
12
|
+
loadingIcon: {},
|
|
13
|
+
plain: { type: Boolean, default: !1 },
|
|
14
|
+
text: { type: Boolean },
|
|
15
|
+
link: { type: Boolean },
|
|
16
|
+
bg: { type: Boolean },
|
|
17
|
+
autofocus: { type: Boolean, default: !1 },
|
|
18
|
+
round: { type: Boolean, default: !1 },
|
|
19
|
+
circle: { type: Boolean, default: !1 },
|
|
20
|
+
color: {},
|
|
21
|
+
dark: { type: Boolean, default: !1 },
|
|
22
|
+
autoInsertSpace: { type: Boolean },
|
|
23
|
+
tag: {}
|
|
24
|
+
},
|
|
25
|
+
emits: ["click"],
|
|
26
|
+
setup(e, { emit: l }) {
|
|
27
|
+
const a = l, n = (o) => {
|
|
28
|
+
a("click", o);
|
|
29
|
+
};
|
|
30
|
+
return (o, i) => {
|
|
31
|
+
const d = s("el-button");
|
|
32
|
+
return m(), r(d, p(o.$attrs, {
|
|
33
|
+
type: e.type,
|
|
34
|
+
size: e.size,
|
|
35
|
+
plain: e.plain,
|
|
36
|
+
round: e.round,
|
|
37
|
+
circle: e.circle,
|
|
38
|
+
loading: e.loading,
|
|
39
|
+
disabled: e.disabled,
|
|
40
|
+
autofocus: e.autofocus,
|
|
41
|
+
"native-type": e.nativeType,
|
|
42
|
+
icon: e.icon,
|
|
43
|
+
color: e.color,
|
|
44
|
+
dark: e.dark,
|
|
45
|
+
onClick: n
|
|
46
|
+
}), {
|
|
47
|
+
default: y(() => [
|
|
48
|
+
g(o.$slots, "default", {}, void 0, !0)
|
|
49
|
+
]),
|
|
50
|
+
_: 3
|
|
51
|
+
}, 16, ["type", "size", "plain", "round", "circle", "loading", "disabled", "autofocus", "native-type", "icon", "color", "dark"]);
|
|
52
|
+
};
|
|
53
|
+
}
|
|
54
|
+
}), v = (e, l) => {
|
|
55
|
+
const a = e.__vccOpts || e;
|
|
56
|
+
for (const [n, o] of l)
|
|
57
|
+
a[n] = o;
|
|
58
|
+
return a;
|
|
59
|
+
}, h = /* @__PURE__ */ v(V, [["__scopeId", "data-v-0a65eb80"]]), I = /* @__PURE__ */ f({
|
|
60
|
+
name: "PacvueElSelect",
|
|
61
|
+
__name: "index",
|
|
62
|
+
props: /* @__PURE__ */ c({
|
|
63
|
+
ariaLabel: {},
|
|
64
|
+
emptyValues: {},
|
|
65
|
+
valueOnClear: {},
|
|
66
|
+
name: {},
|
|
67
|
+
id: {},
|
|
68
|
+
modelValue: {},
|
|
69
|
+
autocomplete: { default: "off" },
|
|
70
|
+
automaticDropdown: { type: Boolean, default: !1 },
|
|
71
|
+
size: { default: "default" },
|
|
72
|
+
effect: {},
|
|
73
|
+
disabled: { type: Boolean, default: !1 },
|
|
74
|
+
clearable: { type: Boolean, default: !1 },
|
|
75
|
+
filterable: { type: Boolean, default: !1 },
|
|
76
|
+
allowCreate: { type: Boolean, default: !1 },
|
|
77
|
+
loading: { type: Boolean, default: !1 },
|
|
78
|
+
popperClass: {},
|
|
79
|
+
popperStyle: {},
|
|
80
|
+
popperOptions: {},
|
|
81
|
+
remote: { type: Boolean, default: !1 },
|
|
82
|
+
debounce: {},
|
|
83
|
+
loadingText: {},
|
|
84
|
+
noMatchText: {},
|
|
85
|
+
noDataText: {},
|
|
86
|
+
remoteMethod: {},
|
|
87
|
+
filterMethod: {},
|
|
88
|
+
multiple: { type: Boolean, default: !1 },
|
|
89
|
+
multipleLimit: { default: 0 },
|
|
90
|
+
placeholder: {},
|
|
91
|
+
defaultFirstOption: { type: Boolean, default: !1 },
|
|
92
|
+
reserveKeyword: { type: Boolean, default: !1 },
|
|
93
|
+
valueKey: {},
|
|
94
|
+
collapseTags: { type: Boolean, default: !1 },
|
|
95
|
+
collapseTagsTooltip: { type: Boolean, default: !1 },
|
|
96
|
+
maxCollapseTags: {},
|
|
97
|
+
teleported: { type: Boolean, default: !0 },
|
|
98
|
+
persistent: { type: Boolean, default: !1 },
|
|
99
|
+
clearIcon: {},
|
|
100
|
+
fitInputWidth: { type: Boolean, default: !1 },
|
|
101
|
+
suffixIcon: {},
|
|
102
|
+
tagType: {},
|
|
103
|
+
tagEffect: {},
|
|
104
|
+
validateEvent: { type: Boolean, default: !0 },
|
|
105
|
+
remoteShowSuffix: { type: Boolean },
|
|
106
|
+
showArrow: { type: Boolean },
|
|
107
|
+
offset: {},
|
|
108
|
+
placement: {},
|
|
109
|
+
fallbackPlacements: {},
|
|
110
|
+
tabindex: {},
|
|
111
|
+
appendTo: {},
|
|
112
|
+
options: {},
|
|
113
|
+
props: {}
|
|
114
|
+
}, {
|
|
115
|
+
modelValue: {},
|
|
116
|
+
modelModifiers: {}
|
|
117
|
+
}),
|
|
118
|
+
emits: /* @__PURE__ */ c(["update:modelValue", "change", "visible-change", "remove-tag", "clear", "blur", "focus"], ["update:modelValue"]),
|
|
119
|
+
setup(e, { emit: l }) {
|
|
120
|
+
const a = l, n = C(e, "modelValue"), o = (t) => {
|
|
121
|
+
a("change", t);
|
|
122
|
+
}, i = (t) => {
|
|
123
|
+
a("visible-change", t);
|
|
124
|
+
}, d = (t) => {
|
|
125
|
+
a("remove-tag", t);
|
|
126
|
+
}, b = () => {
|
|
127
|
+
a("clear");
|
|
128
|
+
}, x = (t) => {
|
|
129
|
+
a("blur", t);
|
|
130
|
+
}, T = (t) => {
|
|
131
|
+
a("focus", t);
|
|
132
|
+
};
|
|
133
|
+
return (t, u) => {
|
|
134
|
+
const w = s("el-select");
|
|
135
|
+
return m(), r(w, p(t.$attrs, {
|
|
136
|
+
modelValue: n.value,
|
|
137
|
+
"onUpdate:modelValue": u[0] || (u[0] = (k) => n.value = k),
|
|
138
|
+
multiple: e.multiple,
|
|
139
|
+
disabled: e.disabled,
|
|
140
|
+
"value-key": e.valueKey,
|
|
141
|
+
size: e.size,
|
|
142
|
+
clearable: e.clearable,
|
|
143
|
+
"collapse-tags": e.collapseTags,
|
|
144
|
+
"collapse-tags-tooltip": e.collapseTagsTooltip,
|
|
145
|
+
"multiple-limit": e.multipleLimit,
|
|
146
|
+
name: e.name,
|
|
147
|
+
autocomplete: e.autocomplete,
|
|
148
|
+
placeholder: e.placeholder,
|
|
149
|
+
filterable: e.filterable,
|
|
150
|
+
"allow-create": e.allowCreate,
|
|
151
|
+
"filter-method": e.filterMethod,
|
|
152
|
+
remote: e.remote,
|
|
153
|
+
"remote-method": e.remoteMethod,
|
|
154
|
+
loading: e.loading,
|
|
155
|
+
"loading-text": e.loadingText,
|
|
156
|
+
"no-match-text": e.noMatchText,
|
|
157
|
+
"no-data-text": e.noDataText,
|
|
158
|
+
"popper-class": e.popperClass,
|
|
159
|
+
"reserve-keyword": e.reserveKeyword,
|
|
160
|
+
"default-first-option": e.defaultFirstOption,
|
|
161
|
+
"popper-append-to-body": t.popperAppendToBody,
|
|
162
|
+
teleported: e.teleported,
|
|
163
|
+
persistent: e.persistent,
|
|
164
|
+
"automatic-dropdown": e.automaticDropdown,
|
|
165
|
+
"clear-icon": e.clearIcon,
|
|
166
|
+
"fit-input-width": e.fitInputWidth,
|
|
167
|
+
"suffix-icon": e.suffixIcon,
|
|
168
|
+
"tag-type": e.tagType,
|
|
169
|
+
"validate-event": e.validateEvent,
|
|
170
|
+
onChange: o,
|
|
171
|
+
onVisibleChange: i,
|
|
172
|
+
onRemoveTag: d,
|
|
173
|
+
onClear: b,
|
|
174
|
+
onBlur: x,
|
|
175
|
+
onFocus: T
|
|
176
|
+
}), {
|
|
177
|
+
default: y(() => [
|
|
178
|
+
g(t.$slots, "default", {}, void 0, !0)
|
|
179
|
+
]),
|
|
180
|
+
_: 3
|
|
181
|
+
}, 16, ["modelValue", "multiple", "disabled", "value-key", "size", "clearable", "collapse-tags", "collapse-tags-tooltip", "multiple-limit", "name", "autocomplete", "placeholder", "filterable", "allow-create", "filter-method", "remote", "remote-method", "loading", "loading-text", "no-match-text", "no-data-text", "popper-class", "reserve-keyword", "default-first-option", "popper-append-to-body", "teleported", "persistent", "automatic-dropdown", "clear-icon", "fit-input-width", "suffix-icon", "tag-type", "validate-event"]);
|
|
182
|
+
};
|
|
183
|
+
}
|
|
184
|
+
}), B = /* @__PURE__ */ v(I, [["__scopeId", "data-v-eef2e744"]]), M = [h, B], z = (e) => {
|
|
185
|
+
M.forEach((l) => {
|
|
186
|
+
e.component(l.name || l.__name, l);
|
|
187
|
+
});
|
|
188
|
+
}, S = {
|
|
189
|
+
install: z,
|
|
190
|
+
PacvueElButton: h,
|
|
191
|
+
PacvueElSelect: B
|
|
192
|
+
};
|
|
193
|
+
export {
|
|
194
|
+
h as PacvueElButton,
|
|
195
|
+
B as PacvueElSelect,
|
|
196
|
+
S as default
|
|
197
|
+
};
|
|
198
|
+
//# sourceMappingURL=pacvue.es.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pacvue.es.js","sources":["../src/components/button/index.vue","../src/components/select/index.vue","../src/index.ts"],"sourcesContent":["<template>\r\n <el-button\r\n v-bind=\"$attrs\"\r\n :type=\"type\"\r\n :size=\"size\"\r\n :plain=\"plain\"\r\n :round=\"round\"\r\n :circle=\"circle\"\r\n :loading=\"loading\"\r\n :disabled=\"disabled\"\r\n :autofocus=\"autofocus\"\r\n :native-type=\"nativeType\"\r\n :icon=\"icon\"\r\n :color=\"color\"\r\n :dark=\"dark\"\r\n @click=\"handleClick\"\r\n >\r\n <slot></slot>\r\n </el-button>\r\n</template>\r\n\r\n<script setup lang=\"ts\">\r\nimport type { ButtonProps } from './types'\r\n\r\nconst props = withDefaults(defineProps<ButtonProps>(), {\r\n type: 'default',\r\n size: 'default',\r\n plain: false,\r\n round: false,\r\n circle: false,\r\n loading: false,\r\n disabled: false,\r\n autofocus: false,\r\n nativeType: 'button',\r\n dark: false,\r\n})\r\n\r\nconst emit = defineEmits<{\r\n click: [event: MouseEvent]\r\n}>()\r\n\r\nconst handleClick = (event: MouseEvent) => {\r\n emit('click', event)\r\n}\r\n\r\ndefineOptions({\r\n name: 'PacvueElButton',\r\n})\r\n</script>\r\n\r\n<style scoped lang=\"scss\">\r\n// 可以在这里添加自定义样式\r\n</style>\r\n\r\n","<template>\r\n <el-select\r\n v-bind=\"$attrs\"\r\n v-model=\"modelValue\"\r\n :multiple=\"multiple\"\r\n :disabled=\"disabled\"\r\n :value-key=\"valueKey\"\r\n :size=\"size\"\r\n :clearable=\"clearable\"\r\n :collapse-tags=\"collapseTags\"\r\n :collapse-tags-tooltip=\"collapseTagsTooltip\"\r\n :multiple-limit=\"multipleLimit\"\r\n :name=\"name\"\r\n :autocomplete=\"autocomplete\"\r\n :placeholder=\"placeholder\"\r\n :filterable=\"filterable\"\r\n :allow-create=\"allowCreate\"\r\n :filter-method=\"filterMethod\"\r\n :remote=\"remote\"\r\n :remote-method=\"remoteMethod\"\r\n :loading=\"loading\"\r\n :loading-text=\"loadingText\"\r\n :no-match-text=\"noMatchText\"\r\n :no-data-text=\"noDataText\"\r\n :popper-class=\"popperClass\"\r\n :reserve-keyword=\"reserveKeyword\"\r\n :default-first-option=\"defaultFirstOption\"\r\n :popper-append-to-body=\"popperAppendToBody\"\r\n :teleported=\"teleported\"\r\n :persistent=\"persistent\"\r\n :automatic-dropdown=\"automaticDropdown\"\r\n :clear-icon=\"clearIcon\"\r\n :fit-input-width=\"fitInputWidth\"\r\n :suffix-icon=\"suffixIcon\"\r\n :tag-type=\"tagType\"\r\n :validate-event=\"validateEvent\"\r\n @change=\"handleChange\"\r\n @visible-change=\"handleVisibleChange\"\r\n @remove-tag=\"handleRemoveTag\"\r\n @clear=\"handleClear\"\r\n @blur=\"handleBlur\"\r\n @focus=\"handleFocus\"\r\n >\r\n <slot></slot>\r\n </el-select>\r\n</template>\r\n\r\n<script setup lang=\"ts\">\r\nimport type { SelectProps } from './types'\r\n\r\nconst props = withDefaults(defineProps<SelectProps>(), {\r\n multiple: false,\r\n disabled: false,\r\n size: 'default',\r\n clearable: false,\r\n collapseTags: false,\r\n collapseTagsTooltip: false,\r\n multipleLimit: 0,\r\n autocomplete: 'off',\r\n filterable: false,\r\n allowCreate: false,\r\n remote: false,\r\n loading: false,\r\n reserveKeyword: false,\r\n defaultFirstOption: false,\r\n popperAppendToBody: true,\r\n teleported: true,\r\n persistent: false,\r\n automaticDropdown: false,\r\n fitInputWidth: false,\r\n validateEvent: true,\r\n})\r\n\r\nconst emit = defineEmits<{\r\n 'update:modelValue': [value: any]\r\n change: [value: any]\r\n 'visible-change': [visible: boolean]\r\n 'remove-tag': [value: any]\r\n clear: []\r\n blur: [event: FocusEvent]\r\n focus: [event: FocusEvent]\r\n}>()\r\n\r\nconst modelValue = defineModel<any>()\r\n\r\nconst handleChange = (value: any) => {\r\n emit('change', value)\r\n}\r\n\r\nconst handleVisibleChange = (visible: boolean) => {\r\n emit('visible-change', visible)\r\n}\r\n\r\nconst handleRemoveTag = (value: any) => {\r\n emit('remove-tag', value)\r\n}\r\n\r\nconst handleClear = () => {\r\n emit('clear')\r\n}\r\n\r\nconst handleBlur = (event: FocusEvent) => {\r\n emit('blur', event)\r\n}\r\n\r\nconst handleFocus = (event: FocusEvent) => {\r\n emit('focus', event)\r\n}\r\n\r\ndefineOptions({\r\n name: 'PacvueElSelect',\r\n})\r\n</script>\r\n\r\n<style scoped lang=\"scss\">\r\n// 可以在这里添加自定义样式\r\n</style>\r\n\r\n","import type { App } from 'vue'\r\nimport PacvueElButton from './components/button/index.vue'\r\nimport PacvueElSelect from './components/select/index.vue'\r\nimport './style.css'\r\n\r\n// 导出所有组件\r\nexport { PacvueElButton, PacvueElSelect }\r\n\r\n// 导出组件类型\r\nexport type { ButtonProps } from './components/button/types'\r\nexport type { SelectProps } from './components/select/types'\r\n\r\n// 组件列表\r\nconst components = [PacvueElButton, PacvueElSelect]\r\n\r\n// 定义 install 方法\r\nconst install = (app: App) => {\r\n components.forEach((component) => {\r\n app.component(component.name || component.__name, component)\r\n })\r\n}\r\n\r\n// 支持按需引入\r\nexport default {\r\n install,\r\n PacvueElButton,\r\n PacvueElSelect,\r\n}\r\n\r\n"],"names":["emit","__emit","handleClick","event","_createBlock","_component_el_button","_mergeProps","_ctx","__props","_renderSlot","modelValue","_useModel","handleChange","value","handleVisibleChange","visible","handleRemoveTag","handleClear","handleBlur","handleFocus","_component_el_select","$event","popperAppendToBody","components","PacvueElButton","PacvueElSelect","install","app","component","index"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAqCA,UAAMA,IAAOC,GAIPC,IAAc,CAACC,MAAsB;AACzC,MAAAH,EAAK,SAASG,CAAK;AAAA,IACrB;;;kBA1CEC,EAiBYC,GAjBZC,EAiBYC,EAAA,QAhBI;AAAA,QACb,MAAMC,EAAA;AAAA,QACN,MAAMA,EAAA;AAAA,QACN,OAAOA,EAAA;AAAA,QACP,OAAOA,EAAA;AAAA,QACP,QAAQA,EAAA;AAAA,QACR,SAASA,EAAA;AAAA,QACT,UAAUA,EAAA;AAAA,QACV,WAAWA,EAAA;AAAA,QACX,eAAaA,EAAA;AAAA,QACb,MAAMA,EAAA;AAAA,QACN,OAAOA,EAAA;AAAA,QACP,MAAMA,EAAA;AAAA,QACN,SAAON;AAAA,MAAA;mBAER,MAAa;AAAA,UAAbO,EAAaF,EAAA,QAAA,WAAA,CAAA,GAAA,QAAA,EAAA;AAAA,QAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;ACwDjB,UAAMP,IAAOC,GAUPS,IAAaC,EAAgBH,GAAA,YAAC,GAE9BI,IAAe,CAACC,MAAe;AACnC,MAAAb,EAAK,UAAUa,CAAK;AAAA,IACtB,GAEMC,IAAsB,CAACC,MAAqB;AAChD,MAAAf,EAAK,kBAAkBe,CAAO;AAAA,IAChC,GAEMC,IAAkB,CAACH,MAAe;AACtC,MAAAb,EAAK,cAAca,CAAK;AAAA,IAC1B,GAEMI,IAAc,MAAM;AACxB,MAAAjB,EAAK,OAAO;AAAA,IACd,GAEMkB,IAAa,CAACf,MAAsB;AACxC,MAAAH,EAAK,QAAQG,CAAK;AAAA,IACpB,GAEMgB,IAAc,CAAChB,MAAsB;AACzC,MAAAH,EAAK,SAASG,CAAK;AAAA,IACrB;;;kBA1GEC,EA2CYgB,GA3CZd,EA2CYC,EAAA,QA1CI;AAAA,oBACLG,EAAA;AAAA,sDAAAA,EAAU,QAAAW;AAAA,QAClB,UAAUb,EAAA;AAAA,QACV,UAAUA,EAAA;AAAA,QACV,aAAWA,EAAA;AAAA,QACX,MAAMA,EAAA;AAAA,QACN,WAAWA,EAAA;AAAA,QACX,iBAAeA,EAAA;AAAA,QACf,yBAAuBA,EAAA;AAAA,QACvB,kBAAgBA,EAAA;AAAA,QAChB,MAAMA,EAAA;AAAA,QACN,cAAcA,EAAA;AAAA,QACd,aAAaA,EAAA;AAAA,QACb,YAAYA,EAAA;AAAA,QACZ,gBAAcA,EAAA;AAAA,QACd,iBAAeA,EAAA;AAAA,QACf,QAAQA,EAAA;AAAA,QACR,iBAAeA,EAAA;AAAA,QACf,SAASA,EAAA;AAAA,QACT,gBAAcA,EAAA;AAAA,QACd,iBAAeA,EAAA;AAAA,QACf,gBAAcA,EAAA;AAAA,QACd,gBAAcA,EAAA;AAAA,QACd,mBAAiBA,EAAA;AAAA,QACjB,wBAAsBA,EAAA;AAAA,QACtB,yBAAuBc,EAAAA;AAAAA,QACvB,YAAYd,EAAA;AAAA,QACZ,YAAYA,EAAA;AAAA,QACZ,sBAAoBA,EAAA;AAAA,QACpB,cAAYA,EAAA;AAAA,QACZ,mBAAiBA,EAAA;AAAA,QACjB,eAAaA,EAAA;AAAA,QACb,YAAUA,EAAA;AAAA,QACV,kBAAgBA,EAAA;AAAA,QAChB,UAAQI;AAAA,QACR,iBAAgBE;AAAA,QAChB,aAAYE;AAAA,QACZ,SAAOC;AAAA,QACP,QAAMC;AAAA,QACN,SAAOC;AAAA,MAAA;mBAER,MAAa;AAAA,UAAbV,EAAaF,EAAA,QAAA,WAAA,CAAA,GAAA,QAAA,EAAA;AAAA,QAAA;;;;;kEC9BXgB,IAAa,CAACC,GAAgBC,CAAc,GAG5CC,IAAU,CAACC,MAAa;AAC5B,EAAAJ,EAAW,QAAQ,CAACK,MAAc;AAChC,IAAAD,EAAI,UAAUC,EAAU,QAAQA,EAAU,QAAQA,CAAS;AAAA,EAC7D,CAAC;AACH,GAGAC,IAAe;AAAA,EACb,SAAAH;AAAA,EACA,gBAAAF;AAAA,EACA,gBAAAC;AACF;"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
(function(o,t){typeof exports=="object"&&typeof module<"u"?t(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],t):(o=typeof globalThis<"u"?globalThis:o||self,t(o.Pacvue={},o.Vue))})(this,function(o,t){"use strict";const p=t.defineComponent({name:"PacvueElButton",__name:"index",props:{size:{default:"default"},disabled:{type:Boolean,default:!1},type:{default:"default"},icon:{},nativeType:{default:"button"},loading:{type:Boolean,default:!1},loadingIcon:{},plain:{type:Boolean,default:!1},text:{type:Boolean},link:{type:Boolean},bg:{type:Boolean},autofocus:{type:Boolean,default:!1},round:{type:Boolean,default:!1},circle:{type:Boolean,default:!1},color:{},dark:{type:Boolean,default:!1},autoInsertSpace:{type:Boolean},tag:{}},emits:["click"],setup(e,{emit:n}){const a=n,i=d=>{a("click",d)};return(d,r)=>{const f=t.resolveComponent("el-button");return t.openBlock(),t.createBlock(f,t.mergeProps(d.$attrs,{type:e.type,size:e.size,plain:e.plain,round:e.round,circle:e.circle,loading:e.loading,disabled:e.disabled,autofocus:e.autofocus,"native-type":e.nativeType,icon:e.icon,color:e.color,dark:e.dark,onClick:i}),{default:t.withCtx(()=>[t.renderSlot(d.$slots,"default",{},void 0,!0)]),_:3},16,["type","size","plain","round","circle","loading","disabled","autofocus","native-type","icon","color","dark"])}}}),s=(e,n)=>{const a=e.__vccOpts||e;for(const[i,d]of n)a[i]=d;return a},c=s(p,[["__scopeId","data-v-0a65eb80"]]),u=s(t.defineComponent({name:"PacvueElSelect",__name:"index",props:t.mergeModels({ariaLabel:{},emptyValues:{},valueOnClear:{},name:{},id:{},modelValue:{},autocomplete:{default:"off"},automaticDropdown:{type:Boolean,default:!1},size:{default:"default"},effect:{},disabled:{type:Boolean,default:!1},clearable:{type:Boolean,default:!1},filterable:{type:Boolean,default:!1},allowCreate:{type:Boolean,default:!1},loading:{type:Boolean,default:!1},popperClass:{},popperStyle:{},popperOptions:{},remote:{type:Boolean,default:!1},debounce:{},loadingText:{},noMatchText:{},noDataText:{},remoteMethod:{},filterMethod:{},multiple:{type:Boolean,default:!1},multipleLimit:{default:0},placeholder:{},defaultFirstOption:{type:Boolean,default:!1},reserveKeyword:{type:Boolean,default:!1},valueKey:{},collapseTags:{type:Boolean,default:!1},collapseTagsTooltip:{type:Boolean,default:!1},maxCollapseTags:{},teleported:{type:Boolean,default:!0},persistent:{type:Boolean,default:!1},clearIcon:{},fitInputWidth:{type:Boolean,default:!1},suffixIcon:{},tagType:{},tagEffect:{},validateEvent:{type:Boolean,default:!0},remoteShowSuffix:{type:Boolean},showArrow:{type:Boolean},offset:{},placement:{},fallbackPlacements:{},tabindex:{},appendTo:{},options:{},props:{}},{modelValue:{},modelModifiers:{}}),emits:t.mergeModels(["update:modelValue","change","visible-change","remove-tag","clear","blur","focus"],["update:modelValue"]),setup(e,{emit:n}){const a=n,i=t.useModel(e,"modelValue"),d=l=>{a("change",l)},r=l=>{a("visible-change",l)},f=l=>{a("remove-tag",l)},h=()=>{a("clear")},B=l=>{a("blur",l)},b=l=>{a("focus",l)};return(l,m)=>{const v=t.resolveComponent("el-select");return t.openBlock(),t.createBlock(v,t.mergeProps(l.$attrs,{modelValue:i.value,"onUpdate:modelValue":m[0]||(m[0]=T=>i.value=T),multiple:e.multiple,disabled:e.disabled,"value-key":e.valueKey,size:e.size,clearable:e.clearable,"collapse-tags":e.collapseTags,"collapse-tags-tooltip":e.collapseTagsTooltip,"multiple-limit":e.multipleLimit,name:e.name,autocomplete:e.autocomplete,placeholder:e.placeholder,filterable:e.filterable,"allow-create":e.allowCreate,"filter-method":e.filterMethod,remote:e.remote,"remote-method":e.remoteMethod,loading:e.loading,"loading-text":e.loadingText,"no-match-text":e.noMatchText,"no-data-text":e.noDataText,"popper-class":e.popperClass,"reserve-keyword":e.reserveKeyword,"default-first-option":e.defaultFirstOption,"popper-append-to-body":l.popperAppendToBody,teleported:e.teleported,persistent:e.persistent,"automatic-dropdown":e.automaticDropdown,"clear-icon":e.clearIcon,"fit-input-width":e.fitInputWidth,"suffix-icon":e.suffixIcon,"tag-type":e.tagType,"validate-event":e.validateEvent,onChange:d,onVisibleChange:r,onRemoveTag:f,onClear:h,onBlur:B,onFocus:b}),{default:t.withCtx(()=>[t.renderSlot(l.$slots,"default",{},void 0,!0)]),_:3},16,["modelValue","multiple","disabled","value-key","size","clearable","collapse-tags","collapse-tags-tooltip","multiple-limit","name","autocomplete","placeholder","filterable","allow-create","filter-method","remote","remote-method","loading","loading-text","no-match-text","no-data-text","popper-class","reserve-keyword","default-first-option","popper-append-to-body","teleported","persistent","automatic-dropdown","clear-icon","fit-input-width","suffix-icon","tag-type","validate-event"])}}}),[["__scopeId","data-v-eef2e744"]]),y=[c,u],g={install:e=>{y.forEach(n=>{e.component(n.name||n.__name,n)})},PacvueElButton:c,PacvueElSelect:u};o.PacvueElButton=c,o.PacvueElSelect=u,o.default=g,Object.defineProperties(o,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
|
|
2
|
+
//# sourceMappingURL=pacvue.umd.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pacvue.umd.js","sources":["../src/components/button/index.vue","../src/components/select/index.vue","../src/index.ts"],"sourcesContent":["<template>\r\n <el-button\r\n v-bind=\"$attrs\"\r\n :type=\"type\"\r\n :size=\"size\"\r\n :plain=\"plain\"\r\n :round=\"round\"\r\n :circle=\"circle\"\r\n :loading=\"loading\"\r\n :disabled=\"disabled\"\r\n :autofocus=\"autofocus\"\r\n :native-type=\"nativeType\"\r\n :icon=\"icon\"\r\n :color=\"color\"\r\n :dark=\"dark\"\r\n @click=\"handleClick\"\r\n >\r\n <slot></slot>\r\n </el-button>\r\n</template>\r\n\r\n<script setup lang=\"ts\">\r\nimport type { ButtonProps } from './types'\r\n\r\nconst props = withDefaults(defineProps<ButtonProps>(), {\r\n type: 'default',\r\n size: 'default',\r\n plain: false,\r\n round: false,\r\n circle: false,\r\n loading: false,\r\n disabled: false,\r\n autofocus: false,\r\n nativeType: 'button',\r\n dark: false,\r\n})\r\n\r\nconst emit = defineEmits<{\r\n click: [event: MouseEvent]\r\n}>()\r\n\r\nconst handleClick = (event: MouseEvent) => {\r\n emit('click', event)\r\n}\r\n\r\ndefineOptions({\r\n name: 'PacvueElButton',\r\n})\r\n</script>\r\n\r\n<style scoped lang=\"scss\">\r\n// 可以在这里添加自定义样式\r\n</style>\r\n\r\n","<template>\r\n <el-select\r\n v-bind=\"$attrs\"\r\n v-model=\"modelValue\"\r\n :multiple=\"multiple\"\r\n :disabled=\"disabled\"\r\n :value-key=\"valueKey\"\r\n :size=\"size\"\r\n :clearable=\"clearable\"\r\n :collapse-tags=\"collapseTags\"\r\n :collapse-tags-tooltip=\"collapseTagsTooltip\"\r\n :multiple-limit=\"multipleLimit\"\r\n :name=\"name\"\r\n :autocomplete=\"autocomplete\"\r\n :placeholder=\"placeholder\"\r\n :filterable=\"filterable\"\r\n :allow-create=\"allowCreate\"\r\n :filter-method=\"filterMethod\"\r\n :remote=\"remote\"\r\n :remote-method=\"remoteMethod\"\r\n :loading=\"loading\"\r\n :loading-text=\"loadingText\"\r\n :no-match-text=\"noMatchText\"\r\n :no-data-text=\"noDataText\"\r\n :popper-class=\"popperClass\"\r\n :reserve-keyword=\"reserveKeyword\"\r\n :default-first-option=\"defaultFirstOption\"\r\n :popper-append-to-body=\"popperAppendToBody\"\r\n :teleported=\"teleported\"\r\n :persistent=\"persistent\"\r\n :automatic-dropdown=\"automaticDropdown\"\r\n :clear-icon=\"clearIcon\"\r\n :fit-input-width=\"fitInputWidth\"\r\n :suffix-icon=\"suffixIcon\"\r\n :tag-type=\"tagType\"\r\n :validate-event=\"validateEvent\"\r\n @change=\"handleChange\"\r\n @visible-change=\"handleVisibleChange\"\r\n @remove-tag=\"handleRemoveTag\"\r\n @clear=\"handleClear\"\r\n @blur=\"handleBlur\"\r\n @focus=\"handleFocus\"\r\n >\r\n <slot></slot>\r\n </el-select>\r\n</template>\r\n\r\n<script setup lang=\"ts\">\r\nimport type { SelectProps } from './types'\r\n\r\nconst props = withDefaults(defineProps<SelectProps>(), {\r\n multiple: false,\r\n disabled: false,\r\n size: 'default',\r\n clearable: false,\r\n collapseTags: false,\r\n collapseTagsTooltip: false,\r\n multipleLimit: 0,\r\n autocomplete: 'off',\r\n filterable: false,\r\n allowCreate: false,\r\n remote: false,\r\n loading: false,\r\n reserveKeyword: false,\r\n defaultFirstOption: false,\r\n popperAppendToBody: true,\r\n teleported: true,\r\n persistent: false,\r\n automaticDropdown: false,\r\n fitInputWidth: false,\r\n validateEvent: true,\r\n})\r\n\r\nconst emit = defineEmits<{\r\n 'update:modelValue': [value: any]\r\n change: [value: any]\r\n 'visible-change': [visible: boolean]\r\n 'remove-tag': [value: any]\r\n clear: []\r\n blur: [event: FocusEvent]\r\n focus: [event: FocusEvent]\r\n}>()\r\n\r\nconst modelValue = defineModel<any>()\r\n\r\nconst handleChange = (value: any) => {\r\n emit('change', value)\r\n}\r\n\r\nconst handleVisibleChange = (visible: boolean) => {\r\n emit('visible-change', visible)\r\n}\r\n\r\nconst handleRemoveTag = (value: any) => {\r\n emit('remove-tag', value)\r\n}\r\n\r\nconst handleClear = () => {\r\n emit('clear')\r\n}\r\n\r\nconst handleBlur = (event: FocusEvent) => {\r\n emit('blur', event)\r\n}\r\n\r\nconst handleFocus = (event: FocusEvent) => {\r\n emit('focus', event)\r\n}\r\n\r\ndefineOptions({\r\n name: 'PacvueElSelect',\r\n})\r\n</script>\r\n\r\n<style scoped lang=\"scss\">\r\n// 可以在这里添加自定义样式\r\n</style>\r\n\r\n","import type { App } from 'vue'\r\nimport PacvueElButton from './components/button/index.vue'\r\nimport PacvueElSelect from './components/select/index.vue'\r\nimport './style.css'\r\n\r\n// 导出所有组件\r\nexport { PacvueElButton, PacvueElSelect }\r\n\r\n// 导出组件类型\r\nexport type { ButtonProps } from './components/button/types'\r\nexport type { SelectProps } from './components/select/types'\r\n\r\n// 组件列表\r\nconst components = [PacvueElButton, PacvueElSelect]\r\n\r\n// 定义 install 方法\r\nconst install = (app: App) => {\r\n components.forEach((component) => {\r\n app.component(component.name || component.__name, component)\r\n })\r\n}\r\n\r\n// 支持按需引入\r\nexport default {\r\n install,\r\n PacvueElButton,\r\n PacvueElSelect,\r\n}\r\n\r\n"],"names":["emit","__emit","handleClick","event","_createBlock","_component_el_button","_mergeProps","_ctx","__props","_renderSlot","modelValue","_useModel","handleChange","value","handleVisibleChange","visible","handleRemoveTag","handleClear","handleBlur","handleFocus","_component_el_select","$event","popperAppendToBody","components","PacvueElButton","PacvueElSelect","index","app","component"],"mappings":"8xBAqCA,MAAMA,EAAOC,EAIPC,EAAeC,GAAsB,CACzCH,EAAK,QAASG,CAAK,CACrB,6EA1CEC,EAAAA,YAiBYC,EAjBZC,EAAAA,WAiBYC,EAAA,OAhBI,CACb,KAAMC,EAAA,KACN,KAAMA,EAAA,KACN,MAAOA,EAAA,MACP,MAAOA,EAAA,MACP,OAAQA,EAAA,OACR,QAASA,EAAA,QACT,SAAUA,EAAA,SACV,UAAWA,EAAA,UACX,cAAaA,EAAA,WACb,KAAMA,EAAA,KACN,MAAOA,EAAA,MACP,KAAMA,EAAA,KACN,QAAON,CAAA,sBAER,IAAa,CAAbO,EAAAA,WAAaF,EAAA,OAAA,UAAA,CAAA,EAAA,OAAA,EAAA,CAAA,unDCwDjB,MAAMP,EAAOC,EAUPS,EAAaC,EAAAA,SAAgBH,EAAA,YAAC,EAE9BI,EAAgBC,GAAe,CACnCb,EAAK,SAAUa,CAAK,CACtB,EAEMC,EAAuBC,GAAqB,CAChDf,EAAK,iBAAkBe,CAAO,CAChC,EAEMC,EAAmBH,GAAe,CACtCb,EAAK,aAAca,CAAK,CAC1B,EAEMI,EAAc,IAAM,CACxBjB,EAAK,OAAO,CACd,EAEMkB,EAAcf,GAAsB,CACxCH,EAAK,OAAQG,CAAK,CACpB,EAEMgB,EAAehB,GAAsB,CACzCH,EAAK,QAASG,CAAK,CACrB,6EA1GEC,EAAAA,YA2CYgB,EA3CZd,EAAAA,WA2CYC,EAAA,OA1CI,YACLG,EAAA,2CAAAA,EAAU,MAAAW,GAClB,SAAUb,EAAA,SACV,SAAUA,EAAA,SACV,YAAWA,EAAA,SACX,KAAMA,EAAA,KACN,UAAWA,EAAA,UACX,gBAAeA,EAAA,aACf,wBAAuBA,EAAA,oBACvB,iBAAgBA,EAAA,cAChB,KAAMA,EAAA,KACN,aAAcA,EAAA,aACd,YAAaA,EAAA,YACb,WAAYA,EAAA,WACZ,eAAcA,EAAA,YACd,gBAAeA,EAAA,aACf,OAAQA,EAAA,OACR,gBAAeA,EAAA,aACf,QAASA,EAAA,QACT,eAAcA,EAAA,YACd,gBAAeA,EAAA,YACf,eAAcA,EAAA,WACd,eAAcA,EAAA,YACd,kBAAiBA,EAAA,eACjB,uBAAsBA,EAAA,mBACtB,wBAAuBc,EAAAA,mBACvB,WAAYd,EAAA,WACZ,WAAYA,EAAA,WACZ,qBAAoBA,EAAA,kBACpB,aAAYA,EAAA,UACZ,kBAAiBA,EAAA,cACjB,cAAaA,EAAA,WACb,WAAUA,EAAA,QACV,iBAAgBA,EAAA,cAChB,SAAQI,EACR,gBAAgBE,EAChB,YAAYE,EACZ,QAAOC,EACP,OAAMC,EACN,QAAOC,CAAA,sBAER,IAAa,CAAbV,EAAAA,WAAaF,EAAA,OAAA,UAAA,CAAA,EAAA,OAAA,EAAA,CAAA,yhBC9BXgB,EAAa,CAACC,EAAgBC,CAAc,EAUlDC,EAAe,CACb,QAReC,GAAa,CAC5BJ,EAAW,QAASK,GAAc,CAChCD,EAAI,UAAUC,EAAU,MAAQA,EAAU,OAAQA,CAAS,CAC7D,CAAC,CACH,EAKE,eAAAJ,EACA,eAAAC,CACF"}
|
package/dist/style.css
ADDED
|
File without changes
|
package/package.json
ADDED
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "pacvue-el-components",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"description": "基于 Element Plus 二次封装的组件库",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"main": "./dist/pacvue.umd.js",
|
|
7
|
+
"module": "./dist/pacvue.es.js",
|
|
8
|
+
"types": "./dist/index.d.ts",
|
|
9
|
+
"exports": {
|
|
10
|
+
".": {
|
|
11
|
+
"import": "./dist/pacvue.es.js",
|
|
12
|
+
"require": "./dist/pacvue.umd.js",
|
|
13
|
+
"types": "./dist/index.d.ts"
|
|
14
|
+
},
|
|
15
|
+
"./style.css": "./dist/style.css"
|
|
16
|
+
},
|
|
17
|
+
"files": [
|
|
18
|
+
"dist",
|
|
19
|
+
"src"
|
|
20
|
+
],
|
|
21
|
+
"scripts": {
|
|
22
|
+
"dev": "vite",
|
|
23
|
+
"build": "vite build && vite build --mode lib",
|
|
24
|
+
"build:lib": "vite build --mode lib",
|
|
25
|
+
"preview": "vite preview",
|
|
26
|
+
"type-check": "vue-tsc --noEmit",
|
|
27
|
+
"prepublishOnly": "npm run build:lib",
|
|
28
|
+
"version:patch": "npm version patch",
|
|
29
|
+
"version:minor": "npm version minor",
|
|
30
|
+
"version:major": "npm version major",
|
|
31
|
+
"publish:patch": "npm run version:patch && npm publish",
|
|
32
|
+
"publish:minor": "npm run version:minor && npm publish",
|
|
33
|
+
"publish:major": "npm run version:major && npm publish"
|
|
34
|
+
},
|
|
35
|
+
"keywords": [
|
|
36
|
+
"vue",
|
|
37
|
+
"component-library",
|
|
38
|
+
"element-plus",
|
|
39
|
+
"pacvue",
|
|
40
|
+
"vue3",
|
|
41
|
+
"typescript"
|
|
42
|
+
],
|
|
43
|
+
"author": "",
|
|
44
|
+
"license": "MIT",
|
|
45
|
+
"repository": {
|
|
46
|
+
"type": "git",
|
|
47
|
+
"url": ""
|
|
48
|
+
},
|
|
49
|
+
"homepage": "",
|
|
50
|
+
"bugs": {
|
|
51
|
+
"url": ""
|
|
52
|
+
},
|
|
53
|
+
"dependencies": {
|
|
54
|
+
"element-plus": "^2.4.4",
|
|
55
|
+
"vue": "^3.4.15"
|
|
56
|
+
},
|
|
57
|
+
"devDependencies": {
|
|
58
|
+
"@vitejs/plugin-vue": "^5.0.3",
|
|
59
|
+
"@vue/tsconfig": "^0.5.1",
|
|
60
|
+
"sass": "^1.71.1",
|
|
61
|
+
"typescript": "^5.3.3",
|
|
62
|
+
"unplugin-auto-import": "^0.17.2",
|
|
63
|
+
"unplugin-vue-components": "^0.26.0",
|
|
64
|
+
"vite": "^5.0.11",
|
|
65
|
+
"vite-plugin-dts": "^3.7.0",
|
|
66
|
+
"vue-tsc": "^1.8.27"
|
|
67
|
+
},
|
|
68
|
+
"peerDependencies": {
|
|
69
|
+
"vue": "^3.0.0",
|
|
70
|
+
"element-plus": "^2.0.0"
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<el-button
|
|
3
|
+
v-bind="$attrs"
|
|
4
|
+
:type="type"
|
|
5
|
+
:size="size"
|
|
6
|
+
:plain="plain"
|
|
7
|
+
:round="round"
|
|
8
|
+
:circle="circle"
|
|
9
|
+
:loading="loading"
|
|
10
|
+
:disabled="disabled"
|
|
11
|
+
:autofocus="autofocus"
|
|
12
|
+
:native-type="nativeType"
|
|
13
|
+
:icon="icon"
|
|
14
|
+
:color="color"
|
|
15
|
+
:dark="dark"
|
|
16
|
+
@click="handleClick"
|
|
17
|
+
>
|
|
18
|
+
<slot></slot>
|
|
19
|
+
</el-button>
|
|
20
|
+
</template>
|
|
21
|
+
|
|
22
|
+
<script setup lang="ts">
|
|
23
|
+
import type { ButtonProps } from './types'
|
|
24
|
+
|
|
25
|
+
const props = withDefaults(defineProps<ButtonProps>(), {
|
|
26
|
+
type: 'default',
|
|
27
|
+
size: 'default',
|
|
28
|
+
plain: false,
|
|
29
|
+
round: false,
|
|
30
|
+
circle: false,
|
|
31
|
+
loading: false,
|
|
32
|
+
disabled: false,
|
|
33
|
+
autofocus: false,
|
|
34
|
+
nativeType: 'button',
|
|
35
|
+
dark: false,
|
|
36
|
+
})
|
|
37
|
+
|
|
38
|
+
const emit = defineEmits<{
|
|
39
|
+
click: [event: MouseEvent]
|
|
40
|
+
}>()
|
|
41
|
+
|
|
42
|
+
const handleClick = (event: MouseEvent) => {
|
|
43
|
+
emit('click', event)
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
defineOptions({
|
|
47
|
+
name: 'PacvueElButton',
|
|
48
|
+
})
|
|
49
|
+
</script>
|
|
50
|
+
|
|
51
|
+
<style scoped lang="scss">
|
|
52
|
+
// 可以在这里添加自定义样式
|
|
53
|
+
</style>
|
|
54
|
+
|
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<el-select
|
|
3
|
+
v-bind="$attrs"
|
|
4
|
+
v-model="modelValue"
|
|
5
|
+
:multiple="multiple"
|
|
6
|
+
:disabled="disabled"
|
|
7
|
+
:value-key="valueKey"
|
|
8
|
+
:size="size"
|
|
9
|
+
:clearable="clearable"
|
|
10
|
+
:collapse-tags="collapseTags"
|
|
11
|
+
:collapse-tags-tooltip="collapseTagsTooltip"
|
|
12
|
+
:multiple-limit="multipleLimit"
|
|
13
|
+
:name="name"
|
|
14
|
+
:autocomplete="autocomplete"
|
|
15
|
+
:placeholder="placeholder"
|
|
16
|
+
:filterable="filterable"
|
|
17
|
+
:allow-create="allowCreate"
|
|
18
|
+
:filter-method="filterMethod"
|
|
19
|
+
:remote="remote"
|
|
20
|
+
:remote-method="remoteMethod"
|
|
21
|
+
:loading="loading"
|
|
22
|
+
:loading-text="loadingText"
|
|
23
|
+
:no-match-text="noMatchText"
|
|
24
|
+
:no-data-text="noDataText"
|
|
25
|
+
:popper-class="popperClass"
|
|
26
|
+
:reserve-keyword="reserveKeyword"
|
|
27
|
+
:default-first-option="defaultFirstOption"
|
|
28
|
+
:popper-append-to-body="popperAppendToBody"
|
|
29
|
+
:teleported="teleported"
|
|
30
|
+
:persistent="persistent"
|
|
31
|
+
:automatic-dropdown="automaticDropdown"
|
|
32
|
+
:clear-icon="clearIcon"
|
|
33
|
+
:fit-input-width="fitInputWidth"
|
|
34
|
+
:suffix-icon="suffixIcon"
|
|
35
|
+
:tag-type="tagType"
|
|
36
|
+
:validate-event="validateEvent"
|
|
37
|
+
@change="handleChange"
|
|
38
|
+
@visible-change="handleVisibleChange"
|
|
39
|
+
@remove-tag="handleRemoveTag"
|
|
40
|
+
@clear="handleClear"
|
|
41
|
+
@blur="handleBlur"
|
|
42
|
+
@focus="handleFocus"
|
|
43
|
+
>
|
|
44
|
+
<slot></slot>
|
|
45
|
+
</el-select>
|
|
46
|
+
</template>
|
|
47
|
+
|
|
48
|
+
<script setup lang="ts">
|
|
49
|
+
import type { SelectProps } from './types'
|
|
50
|
+
|
|
51
|
+
const props = withDefaults(defineProps<SelectProps>(), {
|
|
52
|
+
multiple: false,
|
|
53
|
+
disabled: false,
|
|
54
|
+
size: 'default',
|
|
55
|
+
clearable: false,
|
|
56
|
+
collapseTags: false,
|
|
57
|
+
collapseTagsTooltip: false,
|
|
58
|
+
multipleLimit: 0,
|
|
59
|
+
autocomplete: 'off',
|
|
60
|
+
filterable: false,
|
|
61
|
+
allowCreate: false,
|
|
62
|
+
remote: false,
|
|
63
|
+
loading: false,
|
|
64
|
+
reserveKeyword: false,
|
|
65
|
+
defaultFirstOption: false,
|
|
66
|
+
popperAppendToBody: true,
|
|
67
|
+
teleported: true,
|
|
68
|
+
persistent: false,
|
|
69
|
+
automaticDropdown: false,
|
|
70
|
+
fitInputWidth: false,
|
|
71
|
+
validateEvent: true,
|
|
72
|
+
})
|
|
73
|
+
|
|
74
|
+
const emit = defineEmits<{
|
|
75
|
+
'update:modelValue': [value: any]
|
|
76
|
+
change: [value: any]
|
|
77
|
+
'visible-change': [visible: boolean]
|
|
78
|
+
'remove-tag': [value: any]
|
|
79
|
+
clear: []
|
|
80
|
+
blur: [event: FocusEvent]
|
|
81
|
+
focus: [event: FocusEvent]
|
|
82
|
+
}>()
|
|
83
|
+
|
|
84
|
+
const modelValue = defineModel<any>()
|
|
85
|
+
|
|
86
|
+
const handleChange = (value: any) => {
|
|
87
|
+
emit('change', value)
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
const handleVisibleChange = (visible: boolean) => {
|
|
91
|
+
emit('visible-change', visible)
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
const handleRemoveTag = (value: any) => {
|
|
95
|
+
emit('remove-tag', value)
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
const handleClear = () => {
|
|
99
|
+
emit('clear')
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
const handleBlur = (event: FocusEvent) => {
|
|
103
|
+
emit('blur', event)
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
const handleFocus = (event: FocusEvent) => {
|
|
107
|
+
emit('focus', event)
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
defineOptions({
|
|
111
|
+
name: 'PacvueElSelect',
|
|
112
|
+
})
|
|
113
|
+
</script>
|
|
114
|
+
|
|
115
|
+
<style scoped lang="scss">
|
|
116
|
+
// 可以在这里添加自定义样式
|
|
117
|
+
</style>
|
|
118
|
+
|
package/src/index.ts
ADDED
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import type { App } from 'vue'
|
|
2
|
+
import PacvueElButton from './components/button/index.vue'
|
|
3
|
+
import PacvueElSelect from './components/select/index.vue'
|
|
4
|
+
import './style.css'
|
|
5
|
+
|
|
6
|
+
// 导出所有组件
|
|
7
|
+
export { PacvueElButton, PacvueElSelect }
|
|
8
|
+
|
|
9
|
+
// 导出组件类型
|
|
10
|
+
export type { ButtonProps } from './components/button/types'
|
|
11
|
+
export type { SelectProps } from './components/select/types'
|
|
12
|
+
|
|
13
|
+
// 组件列表
|
|
14
|
+
const components = [PacvueElButton, PacvueElSelect]
|
|
15
|
+
|
|
16
|
+
// 定义 install 方法
|
|
17
|
+
const install = (app: App) => {
|
|
18
|
+
components.forEach((component) => {
|
|
19
|
+
app.component(component.name || component.__name, component)
|
|
20
|
+
})
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
// 支持按需引入
|
|
24
|
+
export default {
|
|
25
|
+
install,
|
|
26
|
+
PacvueElButton,
|
|
27
|
+
PacvueElSelect,
|
|
28
|
+
}
|
|
29
|
+
|
package/src/style.css
ADDED