@tmagic/form 1.0.0-beta.11 → 1.0.0-beta.12
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 +1 -0
- package/dist/tmagic-form.es.js +9 -7
- package/dist/tmagic-form.es.js.map +1 -1
- package/dist/tmagic-form.umd.js +9 -7
- package/dist/tmagic-form.umd.js.map +1 -1
- package/package.json +3 -3
- package/src/Form.vue +1 -1
- package/src/FormDialog.vue +1 -1
- package/src/fields/Select.vue +1 -3
- package/src/fields/Text.vue +3 -3
- package/src/utils/form.ts +5 -1
package/README.md
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
# [文档](https://tencent.github.io/tmagic-editor/docs/)
|
package/dist/tmagic-form.es.js
CHANGED
|
@@ -59,7 +59,11 @@ const initValueItem = function(mForm, item, initValue2, value) {
|
|
|
59
59
|
asyncLoadConfig(value, initValue2, item);
|
|
60
60
|
if (name && !items && typeof initValue2[name] !== "undefined") {
|
|
61
61
|
if (typeof value[name] === "undefined") {
|
|
62
|
-
|
|
62
|
+
if (type === "number") {
|
|
63
|
+
value[name] = Number(initValue2[name]);
|
|
64
|
+
} else {
|
|
65
|
+
value[name] = typeof initValue2[name] === "object" ? cloneDeep(initValue2[name]) : initValue2[name];
|
|
66
|
+
}
|
|
63
67
|
}
|
|
64
68
|
return value;
|
|
65
69
|
}
|
|
@@ -3002,8 +3006,6 @@ const _sfc_main$6 = defineComponent({
|
|
|
3002
3006
|
getRequestFuc() {
|
|
3003
3007
|
return getConfig("request");
|
|
3004
3008
|
},
|
|
3005
|
-
async getInitOption() {
|
|
3006
|
-
},
|
|
3007
3009
|
changeHandler(value) {
|
|
3008
3010
|
emit("change", value);
|
|
3009
3011
|
},
|
|
@@ -3060,7 +3062,7 @@ function _sfc_render$6(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
3060
3062
|
"value-key": _ctx.config.valueKey || "value",
|
|
3061
3063
|
"allow-create": _ctx.config.allowCreate,
|
|
3062
3064
|
disabled: _ctx.disabled,
|
|
3063
|
-
"remote-method": _ctx.remoteMethod,
|
|
3065
|
+
"remote-method": _ctx.config.remote && _ctx.remoteMethod,
|
|
3064
3066
|
onChange: _ctx.changeHandler,
|
|
3065
3067
|
onVisibleChange: _ctx.visibleHandler
|
|
3066
3068
|
}, {
|
|
@@ -3168,6 +3170,7 @@ const _sfc_main$4 = defineComponent({
|
|
|
3168
3170
|
},
|
|
3169
3171
|
emits: ["change", "input"],
|
|
3170
3172
|
setup(props, { emit }) {
|
|
3173
|
+
const mForm = inject("mForm");
|
|
3171
3174
|
useAddField(props.prop);
|
|
3172
3175
|
const modelName = computed(() => props.name || props.config.name || "");
|
|
3173
3176
|
return {
|
|
@@ -3176,12 +3179,10 @@ const _sfc_main$4 = defineComponent({
|
|
|
3176
3179
|
emit("change", v);
|
|
3177
3180
|
},
|
|
3178
3181
|
inputHandler(v) {
|
|
3179
|
-
const mForm = inject("mForm");
|
|
3180
3182
|
emit("input", v);
|
|
3181
3183
|
mForm?.$emit("field-input", props.prop, v);
|
|
3182
3184
|
},
|
|
3183
3185
|
buttonClickHandler() {
|
|
3184
|
-
const mForm = inject("mForm");
|
|
3185
3186
|
if (typeof props.config.append === "string")
|
|
3186
3187
|
return;
|
|
3187
3188
|
if (props.config.append?.handler) {
|
|
@@ -3267,13 +3268,14 @@ function _sfc_render$4(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
3267
3268
|
typeof _ctx.config.append === "object" && _ctx.config.append.type === "button" ? (openBlock(), createBlock(_component_el_button, {
|
|
3268
3269
|
key: 1,
|
|
3269
3270
|
style: { "color": "#409eff" },
|
|
3271
|
+
size: _ctx.size,
|
|
3270
3272
|
onClick: withModifiers(_ctx.buttonClickHandler, ["prevent"])
|
|
3271
3273
|
}, {
|
|
3272
3274
|
default: withCtx(() => [
|
|
3273
3275
|
createTextVNode(toDisplayString(_ctx.config.append.text), 1)
|
|
3274
3276
|
]),
|
|
3275
3277
|
_: 1
|
|
3276
|
-
}, 8, ["onClick"])) : createCommentVNode("", true)
|
|
3278
|
+
}, 8, ["size", "onClick"])) : createCommentVNode("", true)
|
|
3277
3279
|
])
|
|
3278
3280
|
} : void 0
|
|
3279
3281
|
]), 1032, ["modelValue", "size", "placeholder", "disabled", "onChange", "onInput"]);
|