@nutui/nutui 3.1.23-beta.2 → 3.1.23-beta.5
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 +7 -0
- package/dist/nutui.es.js +187 -99
- package/dist/nutui.umd.js +187 -99
- package/dist/packages/_es/ActionSheet.js +8 -3
- package/dist/packages/_es/Address.js +1 -1
- package/dist/packages/_es/AddressList.js +1 -1
- package/dist/packages/_es/Animate.js +1 -1
- package/dist/packages/_es/Audio.js +1 -1
- package/dist/packages/_es/AudioOperate.js +1 -1
- package/dist/packages/_es/Avatar.js +1 -1
- package/dist/packages/_es/AvatarGroup.js +1 -1
- package/dist/packages/_es/BackTop.js +1 -1
- package/dist/packages/_es/Badge.js +1 -1
- package/dist/packages/_es/Barrage.js +1 -1
- package/dist/packages/_es/Button.js +1 -1
- package/dist/packages/_es/Calendar.js +1 -1
- package/dist/packages/_es/CalendarItem.js +1 -1
- package/dist/packages/_es/Card.js +7 -4
- package/dist/packages/_es/Cascader.js +1 -1
- package/dist/packages/_es/Category.js +1 -1
- package/dist/packages/_es/CategoryPane.js +1 -1
- package/dist/packages/_es/Cell.js +1 -1
- package/dist/packages/_es/CellGroup.js +1 -1
- package/dist/packages/_es/Checkbox.js +1 -1
- package/dist/packages/_es/CheckboxGroup.js +1 -1
- package/dist/packages/_es/CircleProgress.js +1 -1
- package/dist/packages/_es/Col.js +1 -1
- package/dist/packages/_es/Collapse.js +1 -1
- package/dist/packages/_es/CollapseItem.js +1 -1
- package/dist/packages/_es/Comment.js +4 -3
- package/dist/packages/_es/ConfigProvider.js +1 -1
- package/dist/packages/_es/CountDown.js +1 -1
- package/dist/packages/_es/CountUp.js +1 -1
- package/dist/packages/_es/DatePicker.js +16 -5
- package/dist/packages/_es/Dialog.js +1 -1
- package/dist/packages/_es/Divider.js +1 -1
- package/dist/packages/_es/Drag.js +1 -1
- package/dist/packages/_es/Ecard.js +1 -1
- package/dist/packages/_es/Elevator.js +1 -1
- package/dist/packages/_es/Ellipsis.js +1 -1
- package/dist/packages/_es/Empty.js +1 -1
- package/dist/packages/_es/FixedNav.js +1 -1
- package/dist/packages/_es/Form.js +1 -1
- package/dist/packages/_es/FormItem.js +1 -1
- package/dist/packages/_es/Grid.js +1 -1
- package/dist/packages/_es/GridItem.js +1 -1
- package/dist/packages/_es/Icon.js +1 -1
- package/dist/packages/_es/Image.js +1 -1
- package/dist/packages/_es/ImagePreview.js +1 -1
- package/dist/packages/_es/Indicator.js +1 -1
- package/dist/packages/_es/InfiniteLoading.js +1 -1
- package/dist/packages/_es/Input.js +1 -1
- package/dist/packages/_es/InputNumber.js +1 -1
- package/dist/packages/_es/Layout.js +1 -1
- package/dist/packages/_es/List.js +1 -1
- package/dist/packages/_es/Menu.js +1 -1
- package/dist/packages/_es/MenuItem.js +1 -1
- package/dist/packages/_es/Navbar.js +1 -1
- package/dist/packages/_es/NoticeBar.js +1 -1
- package/dist/packages/_es/Notify.js +1 -1
- package/dist/packages/_es/NumberKeyboard.js +1 -1
- package/dist/packages/_es/OldPicker.js +1 -1
- package/dist/packages/_es/OverLay.js +1 -1
- package/dist/packages/_es/Pagination.js +1 -1
- package/dist/packages/_es/Picker.js +53 -27
- package/dist/packages/_es/Popover.js +1 -1
- package/dist/packages/_es/Popup.js +1 -1
- package/dist/packages/_es/Price.js +1 -1
- package/dist/packages/_es/Progress.js +1 -1
- package/dist/packages/_es/PullRefresh.js +1 -1
- package/dist/packages/_es/Radio.js +1 -1
- package/dist/packages/_es/RadioGroup.js +1 -1
- package/dist/packages/_es/Range.js +1 -1
- package/dist/packages/_es/Rate.js +1 -1
- package/dist/packages/_es/Row.js +1 -1
- package/dist/packages/_es/SearchBar.js +1 -1
- package/dist/packages/_es/ShortPassword.js +1 -1
- package/dist/packages/_es/SideNavBar.js +1 -1
- package/dist/packages/_es/SideNavBarItem.js +1 -1
- package/dist/packages/_es/Signature.js +1 -1
- package/dist/packages/_es/Skeleton.js +1 -1
- package/dist/packages/_es/Sku.js +1 -1
- package/dist/packages/_es/Step.js +1 -1
- package/dist/packages/_es/Steps.js +1 -1
- package/dist/packages/_es/Sticky.js +1 -1
- package/dist/packages/_es/SubSideNavBar.js +1 -1
- package/dist/packages/_es/Swipe.js +1 -1
- package/dist/packages/_es/Swiper.js +1 -1
- package/dist/packages/_es/SwiperItem.js +1 -1
- package/dist/packages/_es/Switch.js +1 -1
- package/dist/packages/_es/TabPane.js +1 -1
- package/dist/packages/_es/Tabbar.js +3 -3
- package/dist/packages/_es/TabbarItem.js +33 -13
- package/dist/packages/_es/Table.js +36 -21
- package/dist/packages/_es/Tabs.js +1 -1
- package/dist/packages/_es/Tag.js +1 -1
- package/dist/packages/_es/TextArea.js +1 -1
- package/dist/packages/_es/TimeDetail.js +1 -1
- package/dist/packages/_es/TimePannel.js +1 -1
- package/dist/packages/_es/TimeSelect.js +1 -1
- package/dist/packages/_es/Toast.js +1 -1
- package/dist/packages/_es/Uploader.js +10 -3
- package/dist/packages/_es/Video.js +1 -1
- package/dist/packages/_es/WaterMark.js +1 -1
- package/dist/packages/_es/common.js +1 -1
- package/dist/packages/_es/component.js +1 -1
- package/dist/packages/_es/index.js +1 -1
- package/dist/packages/_es/index2.js +1 -1
- package/dist/packages/_es/index3.js +1 -1
- package/dist/packages/_es/index4.js +1 -1
- package/dist/packages/_es/index5.js +1 -1
- package/dist/packages/_es/plugin-vue_export-helper.js +1 -1
- package/dist/packages/_es/pxCheck.js +1 -1
- package/dist/packages/_es/raf.js +1 -1
- package/dist/packages/backtop/index.scss +8 -0
- package/dist/packages/badge/index.scss +8 -0
- package/dist/packages/calendar/index.scss +27 -1
- package/dist/packages/cascader/index.scss +13 -0
- package/dist/packages/cell/index.scss +2 -1
- package/dist/packages/locale/lang/baseLang.js +1 -1
- package/dist/packages/locale/lang/en-US.js +1 -1
- package/dist/packages/locale/lang/id-ID.js +1 -1
- package/dist/packages/locale/lang/index.js +1 -1
- package/dist/packages/locale/lang/zh-CN.js +1 -1
- package/dist/packages/locale/lang/zh-TW.js +1 -1
- package/dist/packages/oldpicker/index.scss +2 -0
- package/dist/packages/picker/index.scss +11 -0
- package/dist/packages/table/index.scss +33 -0
- package/dist/packages/timedetail/index.scss +16 -0
- package/dist/packages/timepannel/index.scss +10 -0
- package/dist/packages/timeselect/index.scss +19 -1
- package/dist/packages/uploader/index.scss +10 -0
- package/dist/smartips/attributes.json +8 -0
- package/dist/smartips/tags.json +4 -2
- package/dist/smartips/web-types.json +19 -1
- package/dist/style.css +1 -1
- package/dist/style.es.js +1 -1
- package/dist/styles/themes/default.scss +49 -49
- package/dist/styles/themes/jdb.scss +49 -49
- package/dist/styles/themes/jdt.scss +49 -49
- package/dist/styles/variables-jdb.scss +5 -4
- package/dist/styles/variables-jdt.scss +5 -4
- package/dist/styles/variables.scss +5 -4
- package/dist/types/__VUE/actionsheet/index.vue.d.ts +7 -0
- package/dist/types/__VUE/avatar/index.vue.d.ts +4 -4
- package/dist/types/__VUE/avatargroup/index.vue.d.ts +2 -2
- package/dist/types/__VUE/backtop/index.vue.d.ts +2 -2
- package/dist/types/__VUE/badge/index.vue.d.ts +2 -2
- package/dist/types/__VUE/button/index.vue.d.ts +2 -2
- package/dist/types/__VUE/cascader/index.vue.d.ts +1 -1
- package/dist/types/__VUE/cell/index.vue.d.ts +6 -6
- package/dist/types/__VUE/collapseitem/index.vue.d.ts +2 -2
- package/dist/types/__VUE/datepicker/index.vue.d.ts +7 -0
- package/dist/types/__VUE/grid/index.vue.d.ts +4 -4
- package/dist/types/__VUE/griditem/index.vue.d.ts +1 -1
- package/dist/types/__VUE/input/index.vue.d.ts +2 -2
- package/dist/types/__VUE/picker/Column.vue.d.ts +9 -2
- package/dist/types/__VUE/picker/index.vue.d.ts +16 -2
- package/dist/types/__VUE/step/index.vue.d.ts +2 -2
- package/dist/types/__VUE/tabbar/index.vue.d.ts +1 -1
- package/dist/types/__VUE/tabbaritem/index.vue.d.ts +9 -3
- package/dist/types/__VUE/table/common.d.ts +3 -0
- package/dist/types/__VUE/table/index.vue.d.ts +3 -0
- package/dist/types/__VUE/table/types.d.ts +2 -0
- package/dist/types/__VUE/toast/index.vue.d.ts +2 -2
- package/dist/types/__VUE/uploader/index.vue.d.ts +4 -4
- package/dist/types/__VUE/uploader/uploader.d.ts +1 -0
- package/dist/types/__VUE/video/index.vue.d.ts +1 -1
- package/dist/types/index.d.ts +1 -1
- package/package.json +1 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* @nutui/nutui v3.1.23-beta.
|
|
2
|
+
* @nutui/nutui v3.1.23-beta.5 Thu Jul 28 2022 13:54:36 GMT+0800 (中国标准时间)
|
|
3
3
|
* (c) 2022 @jdf2e.
|
|
4
4
|
* Released under the MIT License.
|
|
5
5
|
*/
|
|
@@ -28,6 +28,10 @@ const _sfc_main$1 = create$1({
|
|
|
28
28
|
readonly: {
|
|
29
29
|
type: Boolean,
|
|
30
30
|
default: false
|
|
31
|
+
},
|
|
32
|
+
threeDimensional: {
|
|
33
|
+
type: Boolean,
|
|
34
|
+
default: true
|
|
31
35
|
}
|
|
32
36
|
},
|
|
33
37
|
emits: ["click", "change"],
|
|
@@ -52,7 +56,6 @@ const _sfc_main$1 = create$1({
|
|
|
52
56
|
});
|
|
53
57
|
const roller = ref(null);
|
|
54
58
|
const list = ref(null);
|
|
55
|
-
const listItem = ref(null);
|
|
56
59
|
const moving = ref(false);
|
|
57
60
|
const touchDeg = ref(0);
|
|
58
61
|
const touchTime = ref(0);
|
|
@@ -64,7 +67,7 @@ const _sfc_main$1 = create$1({
|
|
|
64
67
|
transform: `rotate3d(1, 0, 0, ${touchDeg.value})`
|
|
65
68
|
};
|
|
66
69
|
});
|
|
67
|
-
const
|
|
70
|
+
const touchTileStyle = computed(() => {
|
|
68
71
|
return {
|
|
69
72
|
transition: `transform ${touchTime.value}ms cubic-bezier(0.17, 0.89, 0.45, 1)`,
|
|
70
73
|
transform: `translate3d(0, ${state.scrollDistance}px, 0)`
|
|
@@ -76,7 +79,11 @@ const _sfc_main$1 = create$1({
|
|
|
76
79
|
const onTouchStart = (event) => {
|
|
77
80
|
touch.start(event);
|
|
78
81
|
if (moving.value) {
|
|
79
|
-
|
|
82
|
+
let dom = list.value;
|
|
83
|
+
if (!props.threeDimensional) {
|
|
84
|
+
dom = roller.value;
|
|
85
|
+
}
|
|
86
|
+
const { transform } = window.getComputedStyle(dom);
|
|
80
87
|
state.scrollDistance = +transform.slice(7, transform.length - 1).split(", ")[5];
|
|
81
88
|
}
|
|
82
89
|
state.touchParams.startY = touch.deltaY.value;
|
|
@@ -90,13 +97,8 @@ const _sfc_main$1 = create$1({
|
|
|
90
97
|
preventDefault(event, true);
|
|
91
98
|
}
|
|
92
99
|
state.touchParams.lastY = touch.deltaY.value;
|
|
93
|
-
const now = Date.now();
|
|
94
100
|
let move = state.touchParams.lastY - state.touchParams.startY;
|
|
95
101
|
setMove(move);
|
|
96
|
-
if (now - state.touchParams.startTime > INERTIA_TIME) {
|
|
97
|
-
state.touchParams.startTime = now;
|
|
98
|
-
state.touchParams.startY = state.touchParams.lastY;
|
|
99
|
-
}
|
|
100
102
|
};
|
|
101
103
|
const onTouchEnd = (event) => {
|
|
102
104
|
state.touchParams.lastY = touch.deltaY.value;
|
|
@@ -150,13 +152,15 @@ const _sfc_main$1 = create$1({
|
|
|
150
152
|
setTransform(endMove, type, time, deg);
|
|
151
153
|
state.currIndex = Math.abs(Math.round(endMove / state.lineSpacing)) + 1;
|
|
152
154
|
} else {
|
|
153
|
-
let deg =
|
|
155
|
+
let deg = 0;
|
|
154
156
|
let currentDeg = (-updateMove / state.lineSpacing + 1) * state.rotation;
|
|
155
157
|
const maxDeg = (props.column.length + 1) * state.rotation;
|
|
156
158
|
const minDeg = 0;
|
|
157
|
-
deg = Math.min(Math.max(currentDeg, minDeg), maxDeg)
|
|
158
|
-
|
|
159
|
-
|
|
159
|
+
deg = Math.min(Math.max(currentDeg, minDeg), maxDeg);
|
|
160
|
+
if (minDeg < deg && deg < maxDeg) {
|
|
161
|
+
setTransform(updateMove, null, void 0, deg + "deg");
|
|
162
|
+
state.currIndex = Math.abs(Math.round(updateMove / state.lineSpacing)) + 1;
|
|
163
|
+
}
|
|
160
164
|
}
|
|
161
165
|
};
|
|
162
166
|
const setChooseValue = () => {
|
|
@@ -183,7 +187,14 @@ const _sfc_main$1 = create$1({
|
|
|
183
187
|
setChooseValue();
|
|
184
188
|
};
|
|
185
189
|
watch(() => props.column, (val) => {
|
|
186
|
-
|
|
190
|
+
if (props.column && props.column.length > 0) {
|
|
191
|
+
state.transformY = 0;
|
|
192
|
+
modifyStatus(false);
|
|
193
|
+
}
|
|
194
|
+
}, {
|
|
195
|
+
deep: true
|
|
196
|
+
});
|
|
197
|
+
watch(() => props.value, (val) => {
|
|
187
198
|
state.transformY = 0;
|
|
188
199
|
modifyStatus(false);
|
|
189
200
|
}, {
|
|
@@ -200,19 +211,25 @@ const _sfc_main$1 = create$1({
|
|
|
200
211
|
isHidden,
|
|
201
212
|
roller,
|
|
202
213
|
list,
|
|
203
|
-
listItem,
|
|
204
214
|
onTouchStart,
|
|
205
215
|
onTouchMove,
|
|
206
216
|
onTouchEnd,
|
|
207
217
|
touchRollerStyle,
|
|
208
|
-
|
|
218
|
+
touchTileStyle,
|
|
209
219
|
setMove,
|
|
210
220
|
stopMomentum
|
|
211
221
|
};
|
|
212
222
|
}
|
|
213
223
|
});
|
|
214
|
-
const _hoisted_1$1 =
|
|
215
|
-
|
|
224
|
+
const _hoisted_1$1 = {
|
|
225
|
+
key: 1,
|
|
226
|
+
class: "nut-picker-roller-item-tile"
|
|
227
|
+
};
|
|
228
|
+
const _hoisted_2$1 = /* @__PURE__ */ createElementVNode("view", { class: "nut-picker-roller-mask" }, null, -1);
|
|
229
|
+
const _hoisted_3$1 = {
|
|
230
|
+
key: 0,
|
|
231
|
+
class: "nut-picker-content"
|
|
232
|
+
};
|
|
216
233
|
function _sfc_render$1(_ctx, _cache, $props, $setup, $data, $options) {
|
|
217
234
|
return openBlock(), createElementBlock("view", {
|
|
218
235
|
class: "nut-picker__list",
|
|
@@ -223,29 +240,30 @@ function _sfc_render$1(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
223
240
|
createElementVNode("view", {
|
|
224
241
|
class: "nut-picker-roller",
|
|
225
242
|
ref: "roller",
|
|
226
|
-
style: normalizeStyle(_ctx.touchRollerStyle),
|
|
243
|
+
style: normalizeStyle(_ctx.threeDimensional ? _ctx.touchRollerStyle : _ctx.touchTileStyle),
|
|
227
244
|
onTransitionend: _cache[0] || (_cache[0] = (...args) => _ctx.stopMomentum && _ctx.stopMomentum(...args))
|
|
228
245
|
}, [
|
|
229
246
|
(openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.column, (item, index) => {
|
|
230
247
|
return openBlock(), createElementBlock(Fragment, {
|
|
231
248
|
key: item.value ? item.value : index
|
|
232
249
|
}, [
|
|
233
|
-
item && item.text ? (openBlock(), createElementBlock("view", {
|
|
250
|
+
item && item.text && _ctx.threeDimensional ? (openBlock(), createElementBlock("view", {
|
|
234
251
|
key: 0,
|
|
235
252
|
class: normalizeClass(["nut-picker-roller-item", { "nut-picker-roller-item-hidden": _ctx.isHidden(index + 1) }]),
|
|
236
253
|
style: normalizeStyle(_ctx.setRollerStyle(index + 1))
|
|
237
|
-
}, toDisplayString(item.text), 7)) : createCommentVNode("", true)
|
|
254
|
+
}, toDisplayString(item.text), 7)) : createCommentVNode("", true),
|
|
255
|
+
item && item.text && !_ctx.threeDimensional ? (openBlock(), createElementBlock("view", _hoisted_1$1, toDisplayString(item.text), 1)) : createCommentVNode("", true)
|
|
238
256
|
], 64);
|
|
239
257
|
}), 128))
|
|
240
258
|
], 36),
|
|
241
|
-
|
|
242
|
-
|
|
259
|
+
_hoisted_2$1,
|
|
260
|
+
_ctx.threeDimensional ? (openBlock(), createElementBlock("view", _hoisted_3$1, [
|
|
243
261
|
createElementVNode("view", {
|
|
244
262
|
class: "nut-picker-list-panel",
|
|
245
263
|
ref: "list",
|
|
246
|
-
style: normalizeStyle(_ctx.
|
|
264
|
+
style: normalizeStyle(_ctx.touchTileStyle)
|
|
247
265
|
}, null, 4)
|
|
248
|
-
])
|
|
266
|
+
])) : createCommentVNode("", true)
|
|
249
267
|
], 32);
|
|
250
268
|
}
|
|
251
269
|
var column = /* @__PURE__ */ _export_sfc(_sfc_main$1, [["render", _sfc_render$1]]);
|
|
@@ -282,6 +300,10 @@ const _sfc_main = create({
|
|
|
282
300
|
readonly: {
|
|
283
301
|
type: Boolean,
|
|
284
302
|
default: false
|
|
303
|
+
},
|
|
304
|
+
threeDimensional: {
|
|
305
|
+
type: Boolean,
|
|
306
|
+
default: true
|
|
285
307
|
}
|
|
286
308
|
},
|
|
287
309
|
emits: ["close", "change", "confirm", "update:visible", "update:modelValue"],
|
|
@@ -362,11 +384,14 @@ const _sfc_main = create({
|
|
|
362
384
|
defaultValues.value[columnIndex] = option.value ? option.value : "";
|
|
363
385
|
let index = columnIndex;
|
|
364
386
|
let cursor = option;
|
|
365
|
-
while (cursor && cursor.children) {
|
|
387
|
+
while (cursor && cursor.children && cursor.children[0]) {
|
|
366
388
|
defaultValues.value[index + 1] = cursor.children[0].value;
|
|
367
389
|
index++;
|
|
368
390
|
cursor = cursor.children[0];
|
|
369
391
|
}
|
|
392
|
+
if (cursor && cursor.children && cursor.children.length == 0) {
|
|
393
|
+
defaultValues.value = defaultValues.value.slice(0, index + 1);
|
|
394
|
+
}
|
|
370
395
|
} else {
|
|
371
396
|
defaultValues.value[columnIndex] = option.hasOwnProperty("value") ? option.value : "";
|
|
372
397
|
}
|
|
@@ -475,10 +500,11 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
475
500
|
readonly: _ctx.readonly,
|
|
476
501
|
columnsType: _ctx.columnsType,
|
|
477
502
|
value: _ctx.defaultValues[columnIndex],
|
|
503
|
+
threeDimensional: _ctx.threeDimensional,
|
|
478
504
|
onChange: (option) => {
|
|
479
505
|
_ctx.changeHandler(columnIndex, option);
|
|
480
506
|
}
|
|
481
|
-
}, null, 8, ["itemShow", "column", "readonly", "columnsType", "value", "onChange"])
|
|
507
|
+
}, null, 8, ["itemShow", "column", "readonly", "columnsType", "value", "threeDimensional", "onChange"])
|
|
482
508
|
]);
|
|
483
509
|
}), 128))
|
|
484
510
|
], 512),
|
package/dist/packages/_es/Row.js
CHANGED
package/dist/packages/_es/Sku.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* @nutui/nutui v3.1.23-beta.
|
|
2
|
+
* @nutui/nutui v3.1.23-beta.5 Thu Jul 28 2022 13:54:36 GMT+0800 (中国标准时间)
|
|
3
3
|
* (c) 2022 @jdf2e.
|
|
4
4
|
* Released under the MIT License.
|
|
5
5
|
*/
|
|
@@ -45,10 +45,10 @@ const _sfc_main = create({
|
|
|
45
45
|
val: props.visible,
|
|
46
46
|
children: []
|
|
47
47
|
});
|
|
48
|
-
function changeIndex(active) {
|
|
48
|
+
function changeIndex(index2, active) {
|
|
49
49
|
emit("update:visible", active);
|
|
50
50
|
parentData.modelValue = active;
|
|
51
|
-
emit("tab-switch", parentData.children[
|
|
51
|
+
emit("tab-switch", parentData.children[index2], active);
|
|
52
52
|
}
|
|
53
53
|
let parentData = reactive({
|
|
54
54
|
children: mdValue.children,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* @nutui/nutui v3.1.23-beta.
|
|
2
|
+
* @nutui/nutui v3.1.23-beta.5 Thu Jul 28 2022 13:54:36 GMT+0800 (中国标准时间)
|
|
3
3
|
* (c) 2022 @jdf2e.
|
|
4
4
|
* Released under the MIT License.
|
|
5
5
|
*/
|
|
@@ -15,6 +15,9 @@ const _sfc_main = create({
|
|
|
15
15
|
type: String,
|
|
16
16
|
default: ""
|
|
17
17
|
},
|
|
18
|
+
name: {
|
|
19
|
+
type: String
|
|
20
|
+
},
|
|
18
21
|
icon: {
|
|
19
22
|
type: String,
|
|
20
23
|
default: ""
|
|
@@ -60,15 +63,25 @@ const _sfc_main = create({
|
|
|
60
63
|
});
|
|
61
64
|
const router = useRouter();
|
|
62
65
|
const relation = (child) => {
|
|
66
|
+
var _a;
|
|
63
67
|
if (child.proxy) {
|
|
64
|
-
let index2 = parent.children.length;
|
|
65
|
-
state.index = index2;
|
|
66
68
|
parent.children.push(child.proxy);
|
|
69
|
+
const index2 = computed(() => parent.children.indexOf(child.proxy));
|
|
70
|
+
state.index = (_a = props.name) != null ? _a : index2.value;
|
|
67
71
|
}
|
|
68
72
|
};
|
|
69
73
|
relation(getCurrentInstance());
|
|
70
|
-
|
|
71
|
-
|
|
74
|
+
const active = computed(() => state.index === state.active);
|
|
75
|
+
function change() {
|
|
76
|
+
var _a;
|
|
77
|
+
let key = (_a = props.name) != null ? _a : state.index;
|
|
78
|
+
let index2 = null;
|
|
79
|
+
if (props.name) {
|
|
80
|
+
index2 = parent.children.findIndex((item) => {
|
|
81
|
+
return item.name == key;
|
|
82
|
+
});
|
|
83
|
+
}
|
|
84
|
+
parent.changeIndex(index2 != null ? index2 : key, state.index);
|
|
72
85
|
}
|
|
73
86
|
const choosed = computed(() => {
|
|
74
87
|
if (parent) {
|
|
@@ -78,13 +91,19 @@ const _sfc_main = create({
|
|
|
78
91
|
});
|
|
79
92
|
watch(choosed, (value, oldValue) => {
|
|
80
93
|
state.active = value;
|
|
94
|
+
let index2 = value;
|
|
95
|
+
if (props.name) {
|
|
96
|
+
index2 = parent.children.findIndex((item) => {
|
|
97
|
+
return item.name == value;
|
|
98
|
+
});
|
|
99
|
+
}
|
|
81
100
|
setTimeout(() => {
|
|
82
|
-
if (parent.children[
|
|
83
|
-
window.location.href = parent.children[
|
|
101
|
+
if (parent.children[index2].href) {
|
|
102
|
+
window.location.href = parent.children[index2].href;
|
|
84
103
|
return;
|
|
85
104
|
}
|
|
86
|
-
if (parent.children[
|
|
87
|
-
let to = parent.children[
|
|
105
|
+
if (parent.children[index2].to) {
|
|
106
|
+
let to = parent.children[index2].to;
|
|
88
107
|
if (to && router) {
|
|
89
108
|
router.push(to);
|
|
90
109
|
} else {
|
|
@@ -95,6 +114,7 @@ const _sfc_main = create({
|
|
|
95
114
|
});
|
|
96
115
|
return {
|
|
97
116
|
state,
|
|
117
|
+
active,
|
|
98
118
|
change
|
|
99
119
|
};
|
|
100
120
|
}
|
|
@@ -117,11 +137,11 @@ const _hoisted_6 = { key: 0 };
|
|
|
117
137
|
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
118
138
|
const _component_nut_icon = resolveComponent("nut-icon");
|
|
119
139
|
return openBlock(), createElementBlock("div", {
|
|
120
|
-
class: normalizeClass(["nut-tabbar-item", { "nut-tabbar-item__icon--unactive": _ctx.
|
|
140
|
+
class: normalizeClass(["nut-tabbar-item", { "nut-tabbar-item__icon--unactive": !_ctx.active }]),
|
|
121
141
|
style: normalizeStyle({
|
|
122
|
-
color: _ctx.
|
|
142
|
+
color: _ctx.active ? _ctx.state.activeColor : _ctx.state.unactiveColor
|
|
123
143
|
}),
|
|
124
|
-
onClick: _cache[0] || (_cache[0] = ($event) => _ctx.change(
|
|
144
|
+
onClick: _cache[0] || (_cache[0] = ($event) => _ctx.change())
|
|
125
145
|
}, [
|
|
126
146
|
createElementVNode("view", _hoisted_1, [
|
|
127
147
|
!_ctx.dot ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
|
|
@@ -141,7 +161,7 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
141
161
|
key: 3,
|
|
142
162
|
class: "nut-tabbar-item_icon-box_icon",
|
|
143
163
|
style: normalizeStyle({
|
|
144
|
-
backgroundImage: `url(${_ctx.
|
|
164
|
+
backgroundImage: `url(${_ctx.active ? _ctx.activeImg : _ctx.img})`,
|
|
145
165
|
width: _ctx.state.size,
|
|
146
166
|
height: _ctx.state.size
|
|
147
167
|
})
|