Skip to content

Commit 539b2b0

Browse files
committed
🔧 update: 更新Element Plus和Vant的版本号至1.0.11和1.1.3
1 parent 999ed64 commit 539b2b0

File tree

10 files changed

+74
-68
lines changed

10 files changed

+74
-68
lines changed

packages/docs/guide/adapter.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
适配实现主要在`render`函数中完成,需要处理以下关键任务:
2222

2323
1. 返回目标UI组件的渲染VNode(使用JSX或h函数)
24-
2.`visible`状态绑定到组件的显隐控制属性(推荐单向绑定)
24+
2.`visible`状态绑定到组件的显隐控制属性
2525
3. 传递组件属性、插槽、事件等(通常通过解构`{...config.attrs}`实现)
2626
4. 绑定`componentRef`到组件实例,并通过`onVnodeMounted`回调执行`onMounted`
2727
5. 关联销毁逻辑,在组件关闭时调用`consumer.value!.destroy()`(建议在动画结束回调中执行)
@@ -38,7 +38,7 @@ const myComponentRender = (
3838
return (
3939
<MyComponent
4040
// 2. 显隐控制绑定
41-
modelValue={visible.value}
41+
v-model={visible.value}
4242
// 4. 组件实例引用绑定
4343
ref={componentRef}
4444
onVnodeMounted={onMounted}

packages/element-plus/dist/index.cjs.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 36 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -1,59 +1,60 @@
1-
var b = Object.defineProperty;
1+
var h = Object.defineProperty;
22
var g = Object.getOwnPropertySymbols;
3-
var h = Object.prototype.hasOwnProperty, w = Object.prototype.propertyIsEnumerable;
4-
var p = (l, e, o) => e in l ? b(l, e, { enumerable: !0, configurable: !0, writable: !0, value: o }) : l[e] = o, d = (l, e) => {
5-
for (var o in e || (e = {}))
6-
h.call(e, o) && p(l, o, e[o]);
3+
var w = Object.prototype.hasOwnProperty, M = Object.prototype.propertyIsEnumerable;
4+
var C = (l, o, e) => o in l ? h(l, o, { enumerable: !0, configurable: !0, writable: !0, value: e }) : l[o] = e, d = (l, o) => {
5+
for (var e in o || (o = {}))
6+
w.call(o, e) && C(l, e, o[e]);
77
if (g)
8-
for (var o of g(e))
9-
w.call(e, o) && p(l, o, e[o]);
8+
for (var e of g(o))
9+
M.call(o, e) && C(l, e, o[e]);
1010
return l;
1111
};
12-
import { createAdapter as C, EVENT_NAME as M } from "@vue-cmd/core";
12+
import { createAdapter as v, EVENT_NAME as b } from "@vue-cmd/core";
1313
export * from "@vue-cmd/core";
14-
import { createVNode as v, mergeProps as D } from "vue";
14+
import { createVNode as V, mergeProps as D } from "vue";
1515
import { ElDialog as y, ElDrawer as N } from "element-plus";
16-
const R = (l, e) => {
16+
const R = (l, o) => {
1717
const {
18-
componentRef: o,
18+
componentRef: e,
1919
visible: t,
2020
onMounted: u,
2121
config: i,
2222
consumer: s
23-
} = e, {
23+
} = o, {
2424
title: c,
2525
width: m,
2626
attrs: n,
2727
slots: f
28-
} = i.value, E = (a) => {
29-
var r;
30-
s.value.destroy(), (r = n == null ? void 0 : n.onBeforeClose) == null || r.call(n, a), a();
31-
}, V = (...a) => {
32-
var r;
33-
return s.value.emit(M.destroy), (r = n == null ? void 0 : n.onClosed) == null ? void 0 : r.call(n, ...a);
28+
} = i.value, p = (r) => {
29+
var a;
30+
s.value.destroy(), (a = n == null ? void 0 : n.onBeforeClose) == null || a.call(n, r), r();
31+
}, E = (...r) => {
32+
var a;
33+
return s.value.emit(b.destroy), (a = n == null ? void 0 : n.onClosed) == null ? void 0 : a.call(n, ...r);
3434
};
35-
return v(y, D({
36-
ref: o,
35+
return V(y, D({
36+
ref: e,
3737
modelValue: t.value,
38+
"onUpdate:modelValue": (r) => t.value = r,
3839
onVnodeMounted: u,
3940
title: c,
4041
width: m
4142
}, n, {
42-
beforeClose: E,
43-
onClosed: V
43+
beforeClose: p,
44+
onClosed: E
4445
}), d({
4546
default: () => l
4647
}, f));
47-
}, x = C({
48+
}, x = v({
4849
render: R,
4950
defaultConfig: {
5051
meta: {
5152
name: "element-plus-dialog"
5253
}
5354
}
54-
}), B = (l) => {
55-
const e = x(l);
56-
return (o, t = {}) => e(o, d({
55+
}), k = (l) => {
56+
const o = x(l);
57+
return (e, t = {}) => o(e, d({
5758
attrs: {
5859
// 可拖拽
5960
draggable: !0,
@@ -62,8 +63,8 @@ const R = (l, e) => {
6263
}
6364
}, t));
6465
}, z = (l, {
65-
componentRef: e,
66-
visible: o,
66+
componentRef: o,
67+
visible: e,
6768
onMounted: t,
6869
config: u,
6970
consumer: i
@@ -76,9 +77,10 @@ const R = (l, e) => {
7677
} = u.value, f = () => {
7778
i.value.destroy();
7879
};
79-
return v(N, D({
80-
ref: e,
81-
modelValue: o.value,
80+
return V(N, D({
81+
ref: o,
82+
modelValue: e.value,
83+
"onUpdate:modelValue": (p) => e.value = p,
8284
onVnodeMounted: t,
8385
title: m,
8486
size: n
@@ -87,7 +89,7 @@ const R = (l, e) => {
8789
}), d({
8890
default: () => l
8991
}, c));
90-
}, T = C({
92+
}, B = v({
9193
render: z,
9294
defaultConfig: {
9395
meta: {
@@ -97,6 +99,6 @@ const R = (l, e) => {
9799
});
98100
export {
99101
x as useDialog,
100-
B as useDialogWithDrag,
101-
T as useDrawer
102+
k as useDialogWithDrag,
103+
B as useDrawer
102104
};

packages/element-plus/package.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@vue-cmd/element-plus",
3-
"version": "1.0.10",
3+
"version": "1.0.11",
44
"type": "module",
55
"description": "Element Plus命令式组件适配器 - 让Element Plus的Dialog、Drawer等组件支持命令式调用",
66
"homepage": "https://slothvips.github.io/Vue-Command-Component/",
@@ -62,5 +62,8 @@
6262
"element-plus": "*",
6363
"vue": "*",
6464
"@vue-cmd/core": "workspace:*"
65+
},
66+
"publishConfig": {
67+
"access": "public"
6568
}
6669
}

packages/element-plus/src/dialog.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ const baseRender = (
3737
return (
3838
<ElDialog
3939
ref={componentRef}
40-
modelValue={visible.value}
40+
v-model={visible.value}
4141
onVnodeMounted={onMounted}
4242
title={title}
4343
width={width}

packages/element-plus/src/drawer.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ const baseRender = (
2525
return (
2626
<ElDrawer
2727
ref={componentRef}
28-
modelValue={visible.value}
28+
v-model={visible.value}
2929
onVnodeMounted={onMounted}
3030
title={title}
3131
size={size}

packages/vant/dist/index.cjs.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/vant/dist/index.es.js

Lines changed: 26 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,32 @@
1-
var P = Object.defineProperty;
1+
var g = Object.defineProperty;
22
var n = Object.getOwnPropertySymbols;
3-
var l = Object.prototype.hasOwnProperty, a = Object.prototype.propertyIsEnumerable;
4-
var p = (o, e, t) => e in o ? P(o, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : o[e] = t, m = (o, e) => {
3+
var a = Object.prototype.hasOwnProperty, l = Object.prototype.propertyIsEnumerable;
4+
var p = (o, e, t) => e in o ? g(o, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : o[e] = t, d = (o, e) => {
55
for (var t in e || (e = {}))
6-
l.call(e, t) && p(o, t, e[t]);
6+
a.call(e, t) && p(o, t, e[t]);
77
if (n)
88
for (var t of n(e))
9-
a.call(e, t) && p(o, t, e[t]);
9+
l.call(e, t) && p(o, t, e[t]);
1010
return o;
1111
};
12-
var c = (o, e) => {
12+
var m = (o, e) => {
1313
var t = {};
1414
for (var r in o)
15-
l.call(o, r) && e.indexOf(r) < 0 && (t[r] = o[r]);
15+
a.call(o, r) && e.indexOf(r) < 0 && (t[r] = o[r]);
1616
if (o != null && n)
1717
for (var r of n(o))
18-
e.indexOf(r) < 0 && a.call(o, r) && (t[r] = o[r]);
18+
e.indexOf(r) < 0 && l.call(o, r) && (t[r] = o[r]);
1919
return t;
2020
};
21-
import { createAdapter as g } from "@vue-cmd/core";
21+
import { createAdapter as w } from "@vue-cmd/core";
2222
export * from "@vue-cmd/core";
23-
import { createVNode as w, mergeProps as b } from "vue";
24-
import { merge as h } from "lodash-es";
25-
import { Popup as k } from "vant";
26-
const d = {
23+
import { createVNode as h, mergeProps as k } from "vue";
24+
import { merge as x } from "lodash-es";
25+
import { Popup as y } from "vant";
26+
const c = {
2727
round: !0,
2828
lockScroll: !0
29-
}, x = (o, {
29+
}, V = (o, {
3030
componentRef: e,
3131
visible: t,
3232
onMounted: r,
@@ -35,28 +35,29 @@ const d = {
3535
}) => {
3636
const u = s.value, {
3737
attrs: i
38-
} = u, v = c(u, [
38+
} = u, v = m(u, [
3939
"attrs"
4040
]), C = () => {
4141
f.value.destroy();
4242
};
43-
return w(k, b({
43+
return h(y, k({
4444
ref: e,
4545
show: t.value,
46+
"onUpdate:show": (P) => t.value = P,
4647
onClickCloseIcon: C,
4748
onVnodeMounted: r
48-
}, d, v, i), m({
49+
}, c, v, i), d({
4950
default: () => o
5051
}, s.value.slots));
51-
}, y = g({
52-
render: x,
52+
}, b = w({
53+
render: V,
5354
defaultConfig: {
54-
attrs: d
55+
attrs: c
5556
}
56-
}), N = (o = {}) => {
57-
const e = y(o);
57+
}), O = (o = {}) => {
58+
const e = b(o);
5859
return (t, r = {}) => {
59-
const s = h({}, r, {
60+
const s = x({}, r, {
6061
attrs: {
6162
position: "bottom",
6263
style: {
@@ -68,6 +69,6 @@ const d = {
6869
};
6970
};
7071
export {
71-
y as usePopup,
72-
N as usePopupOnBottom
72+
b as usePopup,
73+
O as usePopupOnBottom
7374
};

packages/vant/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@vue-cmd/vant",
3-
"version": "1.1.1",
3+
"version": "1.1.3",
44
"type": "module",
55
"description": "Vant命令式组件适配器 - 让Vant的Popup、Dialog等组件支持命令式调用,专为移动端优化",
66
"homepage": "https://slothvips.github.io/Vue-Command-Component/",

packages/vant/src/popup.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ const baseRender = (
3939
return (
4040
<Popup
4141
ref={componentRef}
42-
show={visible.value}
42+
v-model:show={visible.value}
4343
onClickCloseIcon={onClose}
4444
onVnodeMounted={onMounted}
4545
{...defaultProps}

0 commit comments

Comments
 (0)