@tmagic/form 1.3.0-alpha.8 → 1.3.0-alpha.9
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/dist/tmagic-form.js +15 -9
- package/dist/tmagic-form.js.map +1 -1
- package/dist/tmagic-form.umd.cjs +15 -9
- package/dist/tmagic-form.umd.cjs.map +1 -1
- package/package.json +3 -3
- package/src/fields/Select.vue +17 -9
- package/src/schema.ts +3 -3
- package/types/schema.d.ts +3 -3
package/dist/tmagic-form.js
CHANGED
|
@@ -3362,12 +3362,16 @@ const _sfc_main$4 = /* @__PURE__ */ defineComponent({
|
|
|
3362
3362
|
return value === v;
|
|
3363
3363
|
};
|
|
3364
3364
|
const mapOptions = (data) => {
|
|
3365
|
-
const {
|
|
3366
|
-
|
|
3367
|
-
|
|
3365
|
+
const {
|
|
3366
|
+
option = {
|
|
3367
|
+
text: "text",
|
|
3368
|
+
value: "value"
|
|
3369
|
+
}
|
|
3370
|
+
} = props.config;
|
|
3371
|
+
const { text = "text", value = "value" } = option;
|
|
3368
3372
|
return data.map((item) => ({
|
|
3369
|
-
text: typeof text === "function" ? text(item) : item[text
|
|
3370
|
-
value: typeof value === "function" ? value(item) : item[value
|
|
3373
|
+
text: typeof text === "function" ? text(item) : item[text],
|
|
3374
|
+
value: typeof value === "function" ? value(item) : item[value]
|
|
3371
3375
|
}));
|
|
3372
3376
|
};
|
|
3373
3377
|
const getOptions = async () => {
|
|
@@ -3378,8 +3382,9 @@ const _sfc_main$4 = /* @__PURE__ */ defineComponent({
|
|
|
3378
3382
|
}
|
|
3379
3383
|
loading.value = true;
|
|
3380
3384
|
let items = [];
|
|
3381
|
-
const {
|
|
3382
|
-
|
|
3385
|
+
const { option } = props.config;
|
|
3386
|
+
if (!option)
|
|
3387
|
+
return [];
|
|
3383
3388
|
const { root = "", totalKey = "total" } = option;
|
|
3384
3389
|
let { body = {}, url } = option;
|
|
3385
3390
|
if (typeof url === "function") {
|
|
@@ -3476,8 +3481,9 @@ const _sfc_main$4 = /* @__PURE__ */ defineComponent({
|
|
|
3476
3481
|
const getInitOption = async () => {
|
|
3477
3482
|
if (!props.model)
|
|
3478
3483
|
return [];
|
|
3479
|
-
const {
|
|
3480
|
-
|
|
3484
|
+
const { option } = props.config;
|
|
3485
|
+
if (!option)
|
|
3486
|
+
return [];
|
|
3481
3487
|
const { root = "", initRoot = "" } = option;
|
|
3482
3488
|
let { initBody = {} } = option;
|
|
3483
3489
|
let options2 = [];
|