@nutui/nutui 3.1.19-beta.1 → 3.1.19-beta.4
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 +9 -8
- package/dist/nutui.es.js +3044 -3533
- package/dist/nutui.umd.js +3135 -3536
- package/dist/packages/_es/ActionSheet.js +64 -42
- package/dist/packages/_es/Address.js +69 -78
- package/dist/packages/_es/Audio.js +12 -12
- package/dist/packages/_es/AudioOperate.js +1 -1
- package/dist/packages/_es/Avatar.js +3 -3
- package/dist/packages/_es/BackTop.js +110 -68
- package/dist/packages/_es/Badge.js +3 -3
- package/dist/packages/_es/Barrage.js +55 -62
- package/dist/packages/_es/Button.js +2 -2
- package/dist/packages/_es/Calendar.js +27 -32
- package/dist/packages/_es/CalendarItem.js +3 -3
- package/dist/packages/_es/Card.js +5 -6
- package/dist/packages/_es/Cascader.js +9 -9
- package/dist/packages/_es/Cell.js +11 -4
- package/dist/packages/_es/CellGroup.js +1 -1
- package/dist/packages/_es/Checkbox.js +13 -3
- package/dist/packages/_es/CheckboxGroup.js +2 -2
- package/dist/packages/_es/CircleProgress.js +40 -149
- package/dist/packages/_es/Col.js +1 -1
- package/dist/packages/_es/Collapse.js +8 -34
- package/dist/packages/_es/CollapseItem.js +59 -90
- package/dist/packages/_es/CountDown.js +11 -10
- package/dist/packages/_es/CountUp.js +51 -43
- package/dist/packages/_es/DatePicker.js +22 -23
- package/dist/packages/_es/Dialog.js +91 -12
- package/dist/packages/_es/Divider.js +4 -4
- package/dist/packages/_es/Drag.js +54 -92
- package/dist/packages/_es/Ecard.js +153 -0
- package/dist/packages/_es/Elevator.js +50 -75
- package/dist/packages/_es/Empty.js +8 -7
- package/dist/packages/_es/FixedNav.js +10 -11
- package/dist/packages/_es/Form.js +5 -9
- package/dist/packages/_es/FormItem.js +1 -1
- package/dist/packages/_es/Grid.js +1 -1
- package/dist/packages/_es/GridItem.js +26 -8
- package/dist/packages/_es/Icon.js +1 -1
- package/dist/packages/_es/ImagePreview.js +83 -14
- package/dist/packages/_es/Indicator.js +3 -3
- package/dist/packages/_es/InfiniteLoading.js +107 -93
- package/dist/packages/_es/Input.js +21 -20
- package/dist/packages/_es/InputNumber.js +16 -23
- package/dist/packages/_es/Layout.js +1 -1
- package/dist/packages/_es/List.js +34 -41
- package/dist/packages/_es/Menu.js +12 -15
- package/dist/packages/_es/MenuItem.js +7 -7
- package/dist/packages/_es/Navbar.js +5 -4
- package/dist/packages/_es/NoticeBar.js +40 -47
- package/dist/packages/_es/Notify.js +166 -27
- package/dist/packages/_es/NumberKeyboard.js +22 -11
- package/dist/packages/_es/OldPicker.js +120 -122
- package/dist/packages/_es/OverLay.js +25 -5
- package/dist/packages/_es/Pagination.js +14 -13
- package/dist/packages/_es/Picker.js +23 -45
- package/dist/packages/_es/Popover.js +29 -154
- package/dist/packages/_es/Popup.js +69 -6
- package/dist/packages/_es/Price.js +5 -17
- package/dist/packages/_es/Progress.js +23 -19
- package/dist/packages/_es/PullRefresh.js +1 -1
- package/dist/packages/_es/Radio.js +14 -4
- package/dist/packages/_es/RadioGroup.js +1 -1
- package/dist/packages/_es/Range.js +33 -46
- package/dist/packages/_es/Rate.js +19 -16
- package/dist/packages/_es/Row.js +1 -1
- package/dist/packages/_es/SearchBar.js +11 -12
- package/dist/packages/_es/ShortPassword.js +75 -96
- package/dist/packages/_es/SideNavBar.js +16 -5
- package/dist/packages/_es/SideNavBarItem.js +1 -1
- package/dist/packages/_es/Signature.js +88 -69
- package/dist/packages/_es/Skeleton.js +11 -8
- package/dist/packages/_es/Sku.js +57 -49
- package/dist/packages/_es/Step.js +1 -1
- package/dist/packages/_es/Steps.js +1 -1
- package/dist/packages/_es/Sticky.js +23 -28
- package/dist/packages/_es/SubSideNavBar.js +1 -1
- package/dist/packages/_es/Swipe.js +26 -39
- package/dist/packages/_es/Swiper.js +14 -32
- package/dist/packages/_es/SwiperItem.js +2 -2
- package/dist/packages/_es/Switch.js +3 -3
- package/dist/packages/_es/TabPane.js +1 -1
- package/dist/packages/_es/Tabbar.js +3 -3
- package/dist/packages/_es/TabbarItem.js +21 -11
- package/dist/packages/_es/Table.js +18 -17
- package/dist/packages/_es/Tabs.js +20 -21
- package/dist/packages/_es/Tag.js +4 -4
- package/dist/packages/_es/TextArea.js +47 -48
- package/dist/packages/_es/TimeDetail.js +3 -4
- package/dist/packages/_es/TimePannel.js +3 -3
- package/dist/packages/_es/TimeSelect.js +7 -8
- package/dist/packages/_es/Toast.js +170 -41
- package/dist/packages/_es/Uploader.js +145 -116
- package/dist/packages/_es/Video.js +9 -8
- package/dist/packages/_es/common.js +1 -1
- package/dist/packages/_es/component.js +165 -3
- package/dist/packages/_es/index.js +6 -44
- package/dist/packages/_es/index2.js +31 -8
- package/dist/packages/_es/index3.js +7 -58
- package/dist/packages/_es/index4.js +56 -413
- package/dist/packages/_es/{index.taro.js → index5.js} +113 -140
- 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 +19 -0
- package/dist/packages/actionsheet/index.scss +8 -0
- package/dist/packages/ecard/index.scss +83 -0
- package/dist/style.css +1 -1
- package/dist/styles/themes/default.scss +48 -47
- package/dist/styles/themes/jdt.scss +48 -47
- package/dist/styles/variables-jdt.scss +3 -0
- package/dist/styles/variables.scss +3 -0
- package/dist/types/__VUE/actionsheet/index.d.ts +280 -0
- package/dist/types/__VUE/address/index.d.ts +386 -0
- package/dist/types/__VUE/audio/index.d.ts +92 -0
- package/dist/types/__VUE/audiooperate/index.d.ts +68 -0
- package/dist/types/__VUE/avatar/index.d.ts +66 -0
- package/dist/types/__VUE/backtop/index.d.ts +105 -0
- package/dist/types/__VUE/badge/index.d.ts +94 -0
- package/dist/types/__VUE/barrage/index.d.ts +80 -0
- package/dist/types/__VUE/button/index.d.ts +116 -0
- package/dist/types/__VUE/calendar/index.d.ts +155 -0
- package/dist/types/__VUE/calendaritem/index.d.ts +195 -0
- package/dist/types/__VUE/card/index.d.ts +81 -0
- package/dist/types/__VUE/cascader/cascader-item.d.ts +76 -0
- package/dist/types/__VUE/cascader/helper.d.ts +8 -0
- package/dist/types/__VUE/cascader/index.d.ts +76 -0
- package/dist/types/__VUE/cascader/tree.d.ts +17 -0
- package/dist/types/__VUE/cascader/types.d.ts +30 -0
- package/dist/types/__VUE/cell/index.d.ts +109 -0
- package/dist/types/__VUE/cellgroup/index.d.ts +38 -0
- package/dist/types/__VUE/checkbox/index.d.ts +102 -0
- package/dist/types/__VUE/checkboxgroup/index.d.ts +39 -0
- package/dist/types/__VUE/circleprogress/index.d.ts +66 -0
- package/dist/types/__VUE/col/index.d.ts +42 -0
- package/dist/types/__VUE/collapse/index.d.ts +104 -0
- package/dist/types/__VUE/collapseitem/index.d.ts +83 -0
- package/dist/types/__VUE/countdown/index.d.ts +91 -0
- package/dist/types/__VUE/countup/index.d.ts +216 -0
- package/dist/types/__VUE/datepicker/index.d.ts +347 -0
- package/dist/types/__VUE/datepicker/utils.d.ts +5 -0
- package/dist/types/__VUE/dialog/index.d.ts +306 -0
- package/dist/types/__VUE/divider/index.d.ts +47 -0
- package/dist/types/__VUE/drag/index.d.ts +61 -0
- package/dist/types/__VUE/ecard/index.d.ts +123 -0
- package/dist/types/__VUE/elevator/index.d.ts +71 -0
- package/dist/types/__VUE/empty/index.d.ts +47 -0
- package/dist/types/__VUE/fixednav/index.d.ts +96 -0
- package/dist/types/__VUE/form/common.d.ts +20 -0
- package/dist/types/__VUE/form/index.d.ts +32 -0
- package/dist/types/__VUE/form/types.d.ts +13 -0
- package/dist/types/__VUE/formitem/index.d.ts +120 -0
- package/dist/types/__VUE/formitem/types.d.ts +10 -0
- package/dist/types/__VUE/grid/common.d.ts +91 -0
- package/dist/types/__VUE/grid/index.d.ts +100 -0
- package/dist/types/__VUE/griditem/index.d.ts +80 -0
- package/dist/types/__VUE/icon/index.d.ts +74 -0
- package/dist/types/__VUE/imagepreview/index.d.ts +125 -0
- package/dist/types/__VUE/indicator/index.d.ts +70 -0
- package/dist/types/__VUE/infiniteloading/index.d.ts +140 -0
- package/dist/types/__VUE/input/index.d.ts +337 -0
- package/dist/types/__VUE/input/util.d.ts +5 -0
- package/dist/types/__VUE/inputnumber/index.d.ts +117 -0
- package/dist/types/__VUE/layout/index.d.ts +13 -0
- package/dist/types/__VUE/list/index.d.ts +48 -0
- package/dist/types/__VUE/menu/index.d.ts +51 -0
- package/dist/types/__VUE/menuitem/index.d.ts +77 -0
- package/dist/types/__VUE/navbar/index.d.ts +83 -0
- package/dist/types/__VUE/noticebar/index.d.ts +209 -0
- package/dist/types/__VUE/notify/index.d.ts +103 -0
- package/dist/types/__VUE/numberkeyboard/index.d.ts +124 -0
- package/dist/types/__VUE/oldpicker/Column.d.ts +96 -0
- package/dist/types/__VUE/oldpicker/commonProps.d.ts +22 -0
- package/dist/types/__VUE/oldpicker/index.d.ts +360 -0
- package/dist/types/__VUE/oldpicker/types.d.ts +24 -0
- package/dist/types/__VUE/overlay/index.d.ts +1614 -0
- package/dist/types/__VUE/pagination/index.d.ts +112 -0
- package/dist/types/__VUE/picker/Column.d.ts +90 -0
- package/dist/types/__VUE/picker/index.d.ts +343 -0
- package/dist/types/__VUE/picker/types.d.ts +26 -0
- package/dist/types/__VUE/popover/index.d.ts +233 -0
- package/dist/types/__VUE/popup/index.d.ts +1734 -0
- package/dist/types/__VUE/popup/use-lock-scroll.d.ts +5 -0
- package/dist/types/__VUE/price/index.d.ts +87 -0
- package/dist/types/__VUE/progress/index.d.ts +138 -0
- package/dist/types/__VUE/pullrefresh/index.d.ts +128 -0
- package/dist/types/__VUE/pullrefresh/use-touch.d.ts +20 -0
- package/dist/types/__VUE/pullrefresh/util.d.ts +6 -0
- package/dist/types/__VUE/radio/index.d.ts +90 -0
- package/dist/types/__VUE/radiogroup/index.d.ts +48 -0
- package/dist/types/__VUE/range/index.d.ts +156 -0
- package/dist/types/__VUE/rate/index.d.ts +142 -0
- package/dist/types/__VUE/row/index.d.ts +63 -0
- package/dist/types/__VUE/searchbar/index.d.ts +100 -0
- package/dist/types/__VUE/shortpassword/index.d.ts +137 -0
- package/dist/types/__VUE/sidenavbar/index.d.ts +36 -0
- package/dist/types/__VUE/sidenavbaritem/index.d.ts +41 -0
- package/dist/types/__VUE/signature/index.d.ts +73 -0
- package/dist/types/__VUE/skeleton/common.d.ts +63 -0
- package/dist/types/__VUE/skeleton/index.d.ts +117 -0
- package/dist/types/__VUE/sku/components/SkuHeader.d.ts +27 -0
- package/dist/types/__VUE/sku/components/SkuOperate.d.ts +70 -0
- package/dist/types/__VUE/sku/components/SkuSelect.d.ts +30 -0
- package/dist/types/__VUE/sku/components/SkuStepper.d.ts +67 -0
- package/dist/types/__VUE/sku/index.d.ts +300 -0
- package/dist/types/__VUE/step/index.d.ts +70 -0
- package/dist/types/__VUE/steps/index.d.ts +47 -0
- package/dist/types/__VUE/sticky/index.d.ts +63 -0
- package/dist/types/__VUE/subsidenavbar/index.d.ts +54 -0
- package/dist/types/__VUE/swipe/index.d.ts +69 -0
- package/dist/types/__VUE/swiper/index.d.ts +163 -0
- package/dist/types/__VUE/swiper/use-touch.d.ts +20 -0
- package/dist/types/__VUE/swiperitem/index.d.ts +24 -0
- package/dist/types/__VUE/switch/index.d.ts +136 -0
- package/dist/types/__VUE/tabbar/index.d.ts +84 -0
- package/dist/types/__VUE/tabbaritem/index.d.ts +108 -0
- package/dist/types/__VUE/table/common.d.ts +55 -0
- package/dist/types/__VUE/table/index.d.ts +76 -0
- package/dist/types/__VUE/table/renderColumn.d.ts +20 -0
- package/dist/types/__VUE/table/types.d.ts +19 -0
- package/dist/types/__VUE/tabpane/index.d.ts +47 -0
- package/dist/types/__VUE/tabs/index.d.ts +128 -0
- package/dist/types/__VUE/tag/index.d.ts +89 -0
- package/dist/types/__VUE/textarea/index.d.ts +121 -0
- package/dist/types/__VUE/timedetail/index.d.ts +48 -0
- package/dist/types/__VUE/timepannel/index.d.ts +43 -0
- package/dist/types/__VUE/timeselect/index.d.ts +82 -0
- package/dist/types/__VUE/toast/index.d.ts +149 -0
- package/dist/types/__VUE/uploader/index.d.ts +258 -0
- package/dist/types/__VUE/uploader/uploader.d.ts +25 -0
- package/dist/types/__VUE/video/index.d.ts +123 -0
- package/dist/{index.d.ts → types/index.d.ts} +0 -0
- package/dist/types/nutui.d.ts +93 -0
- package/package.json +14 -5
- package/dist/nutui.d.ts +0 -104
- package/dist/packages/_es/use-lock-scroll.js +0 -23
- package/dist/packages/_es/util.js +0 -47
|
@@ -0,0 +1,153 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* @nutui/nutui v3.1.19-beta.4 Tue Apr 12 2022 17:39:20 GMT+0800 (中国标准时间)
|
|
3
|
+
* (c) 2022 @jdf2e.
|
|
4
|
+
* Released under the MIT License.
|
|
5
|
+
*/
|
|
6
|
+
import { ref, watch, resolveComponent, openBlock, createElementBlock, createElementVNode, toDisplayString, Fragment, renderList, normalizeClass, withDirectives, vModelText, createTextVNode, createVNode } from "vue";
|
|
7
|
+
import { c as createComponent } from "./component.js";
|
|
8
|
+
import { _ as _export_sfc } from "./plugin-vue_export-helper.js";
|
|
9
|
+
const { componentName, create } = createComponent("ecard");
|
|
10
|
+
const _sfc_main = create({
|
|
11
|
+
props: {
|
|
12
|
+
chooseText: {
|
|
13
|
+
type: String,
|
|
14
|
+
default: "\u8BF7\u9009\u62E9\u7535\u5B50\u5361\u9762\u503C"
|
|
15
|
+
},
|
|
16
|
+
otherValueText: {
|
|
17
|
+
type: String,
|
|
18
|
+
default: "\u5176\u4ED6\u9762\u503C"
|
|
19
|
+
},
|
|
20
|
+
dataList: {
|
|
21
|
+
type: [Object, Array],
|
|
22
|
+
default: () => {
|
|
23
|
+
return [];
|
|
24
|
+
}
|
|
25
|
+
},
|
|
26
|
+
cardAmountMin: {
|
|
27
|
+
type: Number,
|
|
28
|
+
default: 1
|
|
29
|
+
},
|
|
30
|
+
cardAmountMax: {
|
|
31
|
+
type: Number,
|
|
32
|
+
default: 9999
|
|
33
|
+
},
|
|
34
|
+
cardBuyMin: {
|
|
35
|
+
type: Number,
|
|
36
|
+
default: 1
|
|
37
|
+
},
|
|
38
|
+
cardBuyMax: {
|
|
39
|
+
type: Number,
|
|
40
|
+
default: 9999
|
|
41
|
+
},
|
|
42
|
+
modelValue: {
|
|
43
|
+
type: Number,
|
|
44
|
+
default: 0
|
|
45
|
+
},
|
|
46
|
+
placeholder: {
|
|
47
|
+
type: String,
|
|
48
|
+
default: "\u8BF7\u8F93\u51651-5000\u6574\u6570"
|
|
49
|
+
},
|
|
50
|
+
suffix: {
|
|
51
|
+
type: String,
|
|
52
|
+
default: "\xA5"
|
|
53
|
+
}
|
|
54
|
+
},
|
|
55
|
+
emits: ["inputChange", "changeStep", "inputClick", "change", "update:modelValue"],
|
|
56
|
+
setup(props, { emit }) {
|
|
57
|
+
const currentIndex = ref(null);
|
|
58
|
+
const inputValue = ref();
|
|
59
|
+
const stepValue = ref(props.cardAmountMin);
|
|
60
|
+
const money = ref(props.modelValue);
|
|
61
|
+
const handleClick = (item, index2) => {
|
|
62
|
+
currentIndex.value = index2;
|
|
63
|
+
inputValue.value = "";
|
|
64
|
+
emit("change", item);
|
|
65
|
+
};
|
|
66
|
+
const change = (event) => {
|
|
67
|
+
let input = event.target;
|
|
68
|
+
let val = input.value.replace(/[^\d]/g, "");
|
|
69
|
+
inputValue.value = val;
|
|
70
|
+
if (Number(val) > props.cardAmountMax) {
|
|
71
|
+
inputValue.value = props.cardAmountMax;
|
|
72
|
+
}
|
|
73
|
+
if (Number(val) < props.cardAmountMin) {
|
|
74
|
+
inputValue.value = props.cardAmountMin;
|
|
75
|
+
}
|
|
76
|
+
emit("inputChange", Number(inputValue.value));
|
|
77
|
+
};
|
|
78
|
+
const inputClick = () => {
|
|
79
|
+
currentIndex.value = "input";
|
|
80
|
+
emit("update:modelValue", 0);
|
|
81
|
+
emit("inputClick");
|
|
82
|
+
};
|
|
83
|
+
const changeStep = (value) => {
|
|
84
|
+
stepValue.value = value;
|
|
85
|
+
emit("changeStep", stepValue.value);
|
|
86
|
+
};
|
|
87
|
+
watch(() => props.modelValue, (value) => {
|
|
88
|
+
console.log("value", value);
|
|
89
|
+
money.value = value;
|
|
90
|
+
});
|
|
91
|
+
return {
|
|
92
|
+
handleClick,
|
|
93
|
+
changeStep,
|
|
94
|
+
change,
|
|
95
|
+
inputClick,
|
|
96
|
+
stepValue,
|
|
97
|
+
currentIndex,
|
|
98
|
+
inputValue,
|
|
99
|
+
money
|
|
100
|
+
};
|
|
101
|
+
}
|
|
102
|
+
});
|
|
103
|
+
const _hoisted_1 = { class: "nut-ecard" };
|
|
104
|
+
const _hoisted_2 = { class: "nut-ecard__title" };
|
|
105
|
+
const _hoisted_3 = { class: "nut-ecard__list" };
|
|
106
|
+
const _hoisted_4 = ["onClick"];
|
|
107
|
+
const _hoisted_5 = { class: "nut-ecard__list__input--con" };
|
|
108
|
+
const _hoisted_6 = ["placeholder"];
|
|
109
|
+
const _hoisted_7 = { class: "nut-ecard__list__step" };
|
|
110
|
+
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
111
|
+
const _component_nut_inputnumber = resolveComponent("nut-inputnumber");
|
|
112
|
+
return openBlock(), createElementBlock("view", _hoisted_1, [
|
|
113
|
+
createElementVNode("view", _hoisted_2, toDisplayString(_ctx.chooseText), 1),
|
|
114
|
+
createElementVNode("view", _hoisted_3, [
|
|
115
|
+
(openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.dataList, (item, index2) => {
|
|
116
|
+
return openBlock(), createElementBlock("view", {
|
|
117
|
+
key: index2,
|
|
118
|
+
class: normalizeClass(["nut-ecard__list__item", _ctx.currentIndex == index2 ? "active" : ""]),
|
|
119
|
+
onClick: ($event) => _ctx.handleClick(item, index2)
|
|
120
|
+
}, toDisplayString(item.price), 11, _hoisted_4);
|
|
121
|
+
}), 128)),
|
|
122
|
+
createElementVNode("view", {
|
|
123
|
+
class: normalizeClass(["nut-ecard__list__input", _ctx.currentIndex == "input" ? "active" : ""]),
|
|
124
|
+
onClick: _cache[2] || (_cache[2] = (...args) => _ctx.inputClick && _ctx.inputClick(...args))
|
|
125
|
+
}, [
|
|
126
|
+
createElementVNode("view", null, toDisplayString(_ctx.otherValueText), 1),
|
|
127
|
+
createElementVNode("view", _hoisted_5, [
|
|
128
|
+
withDirectives(createElementVNode("input", {
|
|
129
|
+
type: "text",
|
|
130
|
+
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => _ctx.inputValue = $event),
|
|
131
|
+
onInput: _cache[1] || (_cache[1] = (...args) => _ctx.change && _ctx.change(...args)),
|
|
132
|
+
placeholder: _ctx.placeholder
|
|
133
|
+
}, null, 40, _hoisted_6), [
|
|
134
|
+
[vModelText, _ctx.inputValue]
|
|
135
|
+
]),
|
|
136
|
+
createTextVNode(" " + toDisplayString(_ctx.suffix), 1)
|
|
137
|
+
])
|
|
138
|
+
], 2),
|
|
139
|
+
createElementVNode("view", _hoisted_7, [
|
|
140
|
+
createElementVNode("view", null, toDisplayString(_ctx.suffix) + toDisplayString(_ctx.money), 1),
|
|
141
|
+
createVNode(_component_nut_inputnumber, {
|
|
142
|
+
modelValue: _ctx.stepValue,
|
|
143
|
+
"onUpdate:modelValue": _cache[3] || (_cache[3] = ($event) => _ctx.stepValue = $event),
|
|
144
|
+
min: _ctx.cardBuyMin,
|
|
145
|
+
max: _ctx.cardBuyMax,
|
|
146
|
+
onChange: _ctx.changeStep
|
|
147
|
+
}, null, 8, ["modelValue", "min", "max", "onChange"])
|
|
148
|
+
])
|
|
149
|
+
])
|
|
150
|
+
]);
|
|
151
|
+
}
|
|
152
|
+
var index = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]);
|
|
153
|
+
export { index as default };
|
|
@@ -18,14 +18,13 @@ var __spreadValues = (a, b) => {
|
|
|
18
18
|
};
|
|
19
19
|
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
20
20
|
/*!
|
|
21
|
-
* @nutui/nutui v3.1.19-beta.
|
|
21
|
+
* @nutui/nutui v3.1.19-beta.4 Tue Apr 12 2022 17:39:20 GMT+0800 (中国标准时间)
|
|
22
22
|
* (c) 2022 @jdf2e.
|
|
23
23
|
* Released under the MIT License.
|
|
24
24
|
*/
|
|
25
|
-
import { ref, reactive, computed,
|
|
25
|
+
import { ref, reactive, computed, toRefs, nextTick, openBlock, createElementBlock, normalizeClass, createElementVNode, normalizeStyle, Fragment, renderList, toDisplayString, withDirectives, vShow, createCommentVNode, withModifiers } from "vue";
|
|
26
26
|
import { c as createComponent } from "./component.js";
|
|
27
|
-
import { u as useExpose } from "./
|
|
28
|
-
import Taro, { eventCenter, getCurrentInstance } from "@tarojs/taro";
|
|
27
|
+
import { u as useExpose } from "./index3.js";
|
|
29
28
|
import { _ as _export_sfc } from "./plugin-vue_export-helper.js";
|
|
30
29
|
const { componentName, create } = createComponent("elevator");
|
|
31
30
|
const _sfc_main = create({
|
|
@@ -48,7 +47,7 @@ const _sfc_main = create({
|
|
|
48
47
|
emits: ["click-item", "click-index"],
|
|
49
48
|
setup(props, context) {
|
|
50
49
|
const spaceHeight = 23;
|
|
51
|
-
const listview = ref();
|
|
50
|
+
const listview = ref(null);
|
|
52
51
|
const state = reactive({
|
|
53
52
|
anchorIndex: 0,
|
|
54
53
|
listHeight: [],
|
|
@@ -59,9 +58,6 @@ const _sfc_main = create({
|
|
|
59
58
|
},
|
|
60
59
|
scrollStart: false,
|
|
61
60
|
currentIndex: 0,
|
|
62
|
-
query: Taro.createSelectorQuery(),
|
|
63
|
-
scrollTop: 0,
|
|
64
|
-
storageListHeight: [],
|
|
65
61
|
currentData: {}
|
|
66
62
|
});
|
|
67
63
|
const classes = computed(() => {
|
|
@@ -81,11 +77,9 @@ const _sfc_main = create({
|
|
|
81
77
|
y2: 0
|
|
82
78
|
};
|
|
83
79
|
};
|
|
84
|
-
const getData = (el) => {
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
}
|
|
88
|
-
return el.dataset.index;
|
|
80
|
+
const getData = (el, name) => {
|
|
81
|
+
const prefix = "data-";
|
|
82
|
+
return el.getAttribute(prefix + name);
|
|
89
83
|
};
|
|
90
84
|
const setListGroup = (el) => {
|
|
91
85
|
nextTick(() => {
|
|
@@ -97,38 +91,34 @@ const _sfc_main = create({
|
|
|
97
91
|
const calculateHeight = () => {
|
|
98
92
|
let height = 0;
|
|
99
93
|
state.listHeight.push(height);
|
|
100
|
-
state.storageListHeight.push(height);
|
|
101
94
|
for (let i = 0; i < state.listGroup.length; i++) {
|
|
102
|
-
state.
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
state.listHeight.push(height);
|
|
106
|
-
state.storageListHeight.push(height);
|
|
107
|
-
});
|
|
95
|
+
let item = state.listGroup[i];
|
|
96
|
+
height += item.clientHeight;
|
|
97
|
+
state.listHeight.push(height);
|
|
108
98
|
}
|
|
109
99
|
};
|
|
110
|
-
const scrollTo = (
|
|
111
|
-
if (!
|
|
100
|
+
const scrollTo = (index2) => {
|
|
101
|
+
if (!index2 && index2 !== 0) {
|
|
112
102
|
return;
|
|
113
103
|
}
|
|
114
104
|
if (!state.listHeight.length) {
|
|
115
|
-
|
|
105
|
+
calculateHeight();
|
|
116
106
|
}
|
|
117
|
-
if (
|
|
118
|
-
|
|
119
|
-
if (
|
|
120
|
-
|
|
121
|
-
state.currentIndex =
|
|
122
|
-
|
|
107
|
+
if (index2 < 0)
|
|
108
|
+
index2 = 0;
|
|
109
|
+
if (index2 > state.listHeight.length - 2)
|
|
110
|
+
index2 = state.listHeight.length - 2;
|
|
111
|
+
state.currentIndex = index2;
|
|
112
|
+
listview.value.scrollTo(0, state.listHeight[index2]);
|
|
123
113
|
};
|
|
124
114
|
const touchStart = (e) => {
|
|
125
115
|
state.scrollStart = true;
|
|
126
|
-
let
|
|
116
|
+
let index2 = getData(e.target, "index");
|
|
127
117
|
let firstTouch = e.touches[0];
|
|
128
118
|
state.touchState.y1 = firstTouch.pageY;
|
|
129
|
-
state.anchorIndex = +
|
|
130
|
-
state.currentIndex = +
|
|
131
|
-
scrollTo(+
|
|
119
|
+
state.anchorIndex = +index2;
|
|
120
|
+
state.currentIndex = +index2;
|
|
121
|
+
scrollTo(+index2);
|
|
132
122
|
};
|
|
133
123
|
const touchMove = (e) => {
|
|
134
124
|
let firstTouch = e.touches[0];
|
|
@@ -147,15 +137,6 @@ const _sfc_main = create({
|
|
|
147
137
|
const handleClickIndex = (key) => {
|
|
148
138
|
context.emit("click-index", key);
|
|
149
139
|
};
|
|
150
|
-
onMounted(() => {
|
|
151
|
-
if (Taro.getEnv() === "WEB") {
|
|
152
|
-
calculateHeight();
|
|
153
|
-
} else {
|
|
154
|
-
eventCenter.once(getCurrentInstance().router.onReady, () => {
|
|
155
|
-
calculateHeight();
|
|
156
|
-
});
|
|
157
|
-
}
|
|
158
|
-
});
|
|
159
140
|
useExpose({
|
|
160
141
|
scrollTo
|
|
161
142
|
});
|
|
@@ -177,40 +158,34 @@ const _hoisted_2 = ["onClick", "innerHTML"];
|
|
|
177
158
|
const _hoisted_3 = { class: "nut-elevator__bars__inner" };
|
|
178
159
|
const _hoisted_4 = ["data-index", "onClick"];
|
|
179
160
|
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
180
|
-
const _component_scroll_view = resolveComponent("scroll-view");
|
|
181
161
|
return openBlock(), createElementBlock("view", {
|
|
182
162
|
class: normalizeClass(_ctx.classes)
|
|
183
163
|
}, [
|
|
184
|
-
|
|
185
|
-
class: "nut-elevator__list
|
|
186
|
-
"scroll-top": _ctx.scrollTop,
|
|
187
|
-
"scroll-y": true,
|
|
164
|
+
createElementVNode("view", {
|
|
165
|
+
class: "nut-elevator__list",
|
|
188
166
|
ref: "listview",
|
|
189
167
|
style: normalizeStyle({ height: isNaN(+_ctx.height) ? _ctx.height : `${_ctx.height}px` })
|
|
190
|
-
},
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
_: 1
|
|
212
|
-
}, 8, ["scroll-top", "style"]),
|
|
213
|
-
_ctx.indexList.length > 0 ? withDirectives((openBlock(), createElementBlock("view", {
|
|
168
|
+
}, [
|
|
169
|
+
(openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.indexList, (item) => {
|
|
170
|
+
return openBlock(), createElementBlock("view", {
|
|
171
|
+
class: "nut-elevator__list__item",
|
|
172
|
+
key: item[_ctx.acceptKey],
|
|
173
|
+
ref_for: true,
|
|
174
|
+
ref: _ctx.setListGroup
|
|
175
|
+
}, [
|
|
176
|
+
createElementVNode("view", _hoisted_1, toDisplayString(item[_ctx.acceptKey]), 1),
|
|
177
|
+
(openBlock(true), createElementBlock(Fragment, null, renderList(item.list, (subitem) => {
|
|
178
|
+
return openBlock(), createElementBlock("view", {
|
|
179
|
+
class: normalizeClass(["nut-elevator__list__item__name", { "nut-elevator__list__item__name--highcolor": _ctx.currentData.id === subitem.id }]),
|
|
180
|
+
key: subitem["id"],
|
|
181
|
+
onClick: ($event) => _ctx.handleClickItem(item[_ctx.acceptKey], subitem),
|
|
182
|
+
innerHTML: subitem.name
|
|
183
|
+
}, null, 10, _hoisted_2);
|
|
184
|
+
}), 128))
|
|
185
|
+
]);
|
|
186
|
+
}), 128))
|
|
187
|
+
], 4),
|
|
188
|
+
_ctx.indexList.length ? withDirectives((openBlock(), createElementBlock("view", {
|
|
214
189
|
key: 0,
|
|
215
190
|
class: "nut-elevator__code--current"
|
|
216
191
|
}, toDisplayString(_ctx.indexList[_ctx.currentIndex][_ctx.acceptKey]), 513)), [
|
|
@@ -223,10 +198,10 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
223
198
|
onTouchend: _cache[2] || (_cache[2] = (...args) => _ctx.touchEnd && _ctx.touchEnd(...args))
|
|
224
199
|
}, [
|
|
225
200
|
createElementVNode("view", _hoisted_3, [
|
|
226
|
-
(openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.indexList, (item,
|
|
201
|
+
(openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.indexList, (item, index2) => {
|
|
227
202
|
return openBlock(), createElementBlock("view", {
|
|
228
203
|
class: "nut-elevator__bars__inner__item",
|
|
229
|
-
"data-index":
|
|
204
|
+
"data-index": index2,
|
|
230
205
|
key: item[_ctx.acceptKey],
|
|
231
206
|
onClick: ($event) => _ctx.handleClickIndex(item[_ctx.acceptKey])
|
|
232
207
|
}, toDisplayString(item[_ctx.acceptKey]), 9, _hoisted_4);
|
|
@@ -235,5 +210,5 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
235
210
|
], 32)
|
|
236
211
|
], 2);
|
|
237
212
|
}
|
|
238
|
-
var
|
|
239
|
-
export {
|
|
213
|
+
var index = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]);
|
|
214
|
+
export { index as default };
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* @nutui/nutui v3.1.19-beta.
|
|
2
|
+
* @nutui/nutui v3.1.19-beta.4 Tue Apr 12 2022 17:39:20 GMT+0800 (中国标准时间)
|
|
3
3
|
* (c) 2022 @jdf2e.
|
|
4
4
|
* Released under the MIT License.
|
|
5
5
|
*/
|
|
6
6
|
import { toRefs, computed, openBlock, createElementBlock, createElementVNode, normalizeStyle, renderSlot, Fragment, createCommentVNode, toDisplayString } from "vue";
|
|
7
7
|
import { c as createComponent } from "./component.js";
|
|
8
8
|
import { _ as _export_sfc } from "./plugin-vue_export-helper.js";
|
|
9
|
-
const { componentName, create } = createComponent("empty");
|
|
9
|
+
const { componentName, create, translate } = createComponent("empty");
|
|
10
10
|
const defaultStatus = {
|
|
11
11
|
empty: "https://static-ftcms.jd.com/p/files/61a9e3183985005b3958672b.png",
|
|
12
12
|
error: "https://ftcms.jd.com/p/files/61a9e33ee7dcdbcc0ce62736.png",
|
|
@@ -24,7 +24,7 @@ const _sfc_main = create({
|
|
|
24
24
|
},
|
|
25
25
|
description: {
|
|
26
26
|
type: String,
|
|
27
|
-
default: "
|
|
27
|
+
default: ""
|
|
28
28
|
}
|
|
29
29
|
},
|
|
30
30
|
setup(props) {
|
|
@@ -42,7 +42,8 @@ const _sfc_main = create({
|
|
|
42
42
|
const imageUrl = isHttpUrl ? image.value : defaultStatus[image.value];
|
|
43
43
|
return {
|
|
44
44
|
imageUrl,
|
|
45
|
-
imgStyle
|
|
45
|
+
imgStyle,
|
|
46
|
+
translate
|
|
46
47
|
};
|
|
47
48
|
}
|
|
48
49
|
});
|
|
@@ -66,9 +67,9 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
66
67
|
}, null, 8, _hoisted_2)) : createCommentVNode("", true)
|
|
67
68
|
], 64))
|
|
68
69
|
], 4),
|
|
69
|
-
_ctx.$slots.description ? renderSlot(_ctx.$slots, "description", { key: 0 }) : (openBlock(), createElementBlock("view", _hoisted_3, toDisplayString(_ctx.description), 1)),
|
|
70
|
+
_ctx.$slots.description ? renderSlot(_ctx.$slots, "description", { key: 0 }) : (openBlock(), createElementBlock("view", _hoisted_3, toDisplayString(_ctx.description || _ctx.translate("noData")), 1)),
|
|
70
71
|
_ctx.$slots.default ? renderSlot(_ctx.$slots, "default", { key: 2 }) : createCommentVNode("", true)
|
|
71
72
|
]);
|
|
72
73
|
}
|
|
73
|
-
var
|
|
74
|
-
export {
|
|
74
|
+
var index = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]);
|
|
75
|
+
export { index as default };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* @nutui/nutui v3.1.19-beta.
|
|
2
|
+
* @nutui/nutui v3.1.19-beta.4 Tue Apr 12 2022 17:39:20 GMT+0800 (中国标准时间)
|
|
3
3
|
* (c) 2022 @jdf2e.
|
|
4
4
|
* Released under the MIT License.
|
|
5
5
|
*/
|
|
@@ -7,7 +7,7 @@ import { computed, resolveComponent, openBlock, createElementBlock, normalizeCla
|
|
|
7
7
|
import { c as createComponent } from "./component.js";
|
|
8
8
|
import overlay from "./OverLay.js";
|
|
9
9
|
import { _ as _export_sfc } from "./plugin-vue_export-helper.js";
|
|
10
|
-
const { componentName, create } = createComponent("fixednav");
|
|
10
|
+
const { componentName, create, translate } = createComponent("fixednav");
|
|
11
11
|
const _sfc_main = create({
|
|
12
12
|
components: {
|
|
13
13
|
[overlay.name]: overlay
|
|
@@ -26,11 +26,11 @@ const _sfc_main = create({
|
|
|
26
26
|
type: Array
|
|
27
27
|
},
|
|
28
28
|
activeText: {
|
|
29
|
-
default: "
|
|
29
|
+
default: "",
|
|
30
30
|
type: String
|
|
31
31
|
},
|
|
32
32
|
unActiveText: {
|
|
33
|
-
default: "
|
|
33
|
+
default: "",
|
|
34
34
|
type: String
|
|
35
35
|
},
|
|
36
36
|
position: {
|
|
@@ -47,7 +47,6 @@ const _sfc_main = create({
|
|
|
47
47
|
type: String
|
|
48
48
|
}
|
|
49
49
|
},
|
|
50
|
-
components: {},
|
|
51
50
|
emits: ["update:visible", "selected"],
|
|
52
51
|
setup(props, { emit }) {
|
|
53
52
|
const classes = computed(() => {
|
|
@@ -67,7 +66,7 @@ const _sfc_main = create({
|
|
|
67
66
|
event
|
|
68
67
|
});
|
|
69
68
|
};
|
|
70
|
-
return { classes, updateValue, selected };
|
|
69
|
+
return { classes, updateValue, selected, translate };
|
|
71
70
|
}
|
|
72
71
|
});
|
|
73
72
|
const _hoisted_1 = { class: "nut-fixednav__list" };
|
|
@@ -94,11 +93,11 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
94
93
|
}, null, 8, ["visible"])) : createCommentVNode("", true),
|
|
95
94
|
renderSlot(_ctx.$slots, "list", {}, () => [
|
|
96
95
|
createElementVNode("view", _hoisted_1, [
|
|
97
|
-
(openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.navList, (item,
|
|
96
|
+
(openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.navList, (item, index2) => {
|
|
98
97
|
return openBlock(), createElementBlock("view", {
|
|
99
98
|
class: "nut-fixednav__list-item",
|
|
100
99
|
onClick: ($event) => _ctx.selected(item, $event),
|
|
101
|
-
key: item.id ||
|
|
100
|
+
key: item.id || index2
|
|
102
101
|
}, [
|
|
103
102
|
createElementVNode("img", {
|
|
104
103
|
src: item.icon
|
|
@@ -118,10 +117,10 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
118
117
|
name: "left",
|
|
119
118
|
color: "#fff"
|
|
120
119
|
}),
|
|
121
|
-
createElementVNode("view", _hoisted_6, toDisplayString(_ctx.visible ? _ctx.activeText : _ctx.unActiveText), 1)
|
|
120
|
+
createElementVNode("view", _hoisted_6, toDisplayString(_ctx.visible ? _ctx.activeText || _ctx.translate("activeText") : _ctx.unActiveText || _ctx.translate("unActiveText")), 1)
|
|
122
121
|
])
|
|
123
122
|
])
|
|
124
123
|
], 6);
|
|
125
124
|
}
|
|
126
|
-
var
|
|
127
|
-
export {
|
|
125
|
+
var index = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]);
|
|
126
|
+
export { index as default };
|
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* @nutui/nutui v3.1.19-beta.
|
|
2
|
+
* @nutui/nutui v3.1.19-beta.4 Tue Apr 12 2022 17:39:20 GMT+0800 (中国标准时间)
|
|
3
3
|
* (c) 2022 @jdf2e.
|
|
4
4
|
* Released under the MIT License.
|
|
5
5
|
*/
|
|
6
|
-
import { c as createComponent } from "./component.js";
|
|
7
|
-
import { i as isPromise } from "./util.js";
|
|
6
|
+
import { g as getPropByPath, i as isPromise, c as createComponent } from "./component.js";
|
|
8
7
|
import { computed, reactive, provide, watch, resolveComponent, openBlock, createElementBlock, withModifiers, createVNode, withCtx, renderSlot } from "vue";
|
|
9
8
|
import { _ as _export_sfc } from "./plugin-vue_export-helper.js";
|
|
10
9
|
const component = {
|
|
@@ -32,7 +31,7 @@ const component = {
|
|
|
32
31
|
}, { immediate: true });
|
|
33
32
|
const findFormItem = (vnodes) => {
|
|
34
33
|
let task = [];
|
|
35
|
-
vnodes.forEach((vnode,
|
|
34
|
+
vnodes.forEach((vnode, index2) => {
|
|
36
35
|
var _a, _b, _c;
|
|
37
36
|
let type = vnode.type;
|
|
38
37
|
type = type.name || type;
|
|
@@ -61,9 +60,6 @@ const component = {
|
|
|
61
60
|
resolve(errorMsg);
|
|
62
61
|
});
|
|
63
62
|
};
|
|
64
|
-
const getPropByPath = (obj, keyPath) => {
|
|
65
|
-
return keyPath.split(".").reduce((prev, curr) => prev[curr], obj);
|
|
66
|
-
};
|
|
67
63
|
if (!prop) {
|
|
68
64
|
console.warn("[NutUI] <FormItem> \u4F7F\u7528 rules \u6821\u9A8C\u89C4\u5219\u65F6 , \u5FC5\u987B\u8BBE\u7F6E prop \u53C2\u6570");
|
|
69
65
|
}
|
|
@@ -152,5 +148,5 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
152
148
|
})
|
|
153
149
|
], 32);
|
|
154
150
|
}
|
|
155
|
-
var
|
|
156
|
-
export {
|
|
151
|
+
var index = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]);
|
|
152
|
+
export { index as default };
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* @nutui/nutui v3.1.19-beta.
|
|
2
|
+
* @nutui/nutui v3.1.19-beta.4 Tue Apr 12 2022 17:39:20 GMT+0800 (中国标准时间)
|
|
3
3
|
* (c) 2022 @jdf2e.
|
|
4
4
|
* Released under the MIT License.
|
|
5
5
|
*/
|
|
6
6
|
import { inject, getCurrentInstance, onUnmounted, computed, ref, resolveComponent, openBlock, createElementBlock, normalizeClass, normalizeStyle, createElementVNode, renderSlot, Fragment, createBlock, toDisplayString } from "vue";
|
|
7
|
+
import { u as useRouter } from "./index.js";
|
|
7
8
|
import { c as createComponent } from "./component.js";
|
|
8
9
|
import { p as pxCheck } from "./pxCheck.js";
|
|
9
10
|
import { G as GRID_KEY } from "./common.js";
|
|
@@ -15,10 +16,10 @@ function useInject(key) {
|
|
|
15
16
|
const { add, remove, internalChildren } = parent;
|
|
16
17
|
add(instance);
|
|
17
18
|
onUnmounted(() => remove(instance));
|
|
18
|
-
const
|
|
19
|
+
const index2 = computed(() => internalChildren.indexOf(instance));
|
|
19
20
|
return {
|
|
20
21
|
parent,
|
|
21
|
-
index
|
|
22
|
+
index: index2
|
|
22
23
|
};
|
|
23
24
|
}
|
|
24
25
|
return {
|
|
@@ -40,6 +41,17 @@ const _sfc_main = create({
|
|
|
40
41
|
},
|
|
41
42
|
iconColor: {
|
|
42
43
|
type: String
|
|
44
|
+
},
|
|
45
|
+
to: {
|
|
46
|
+
type: [String, Object]
|
|
47
|
+
},
|
|
48
|
+
url: {
|
|
49
|
+
type: String,
|
|
50
|
+
default: ""
|
|
51
|
+
},
|
|
52
|
+
replace: {
|
|
53
|
+
type: Boolean,
|
|
54
|
+
default: false
|
|
43
55
|
}
|
|
44
56
|
},
|
|
45
57
|
emits: ["click"],
|
|
@@ -47,7 +59,7 @@ const _sfc_main = create({
|
|
|
47
59
|
const Parent = useInject(GRID_KEY);
|
|
48
60
|
if (!Parent.parent)
|
|
49
61
|
return;
|
|
50
|
-
const
|
|
62
|
+
const index2 = Parent.index;
|
|
51
63
|
const parent = Parent.parent.props;
|
|
52
64
|
const rootClass = computed(() => {
|
|
53
65
|
const prefixCls = componentName;
|
|
@@ -63,7 +75,7 @@ const _sfc_main = create({
|
|
|
63
75
|
style.paddingTop = `${100 / +parent.columnNum}%`;
|
|
64
76
|
} else if (parent.gutter) {
|
|
65
77
|
style.paddingRight = pxCheck(parent.gutter);
|
|
66
|
-
if (
|
|
78
|
+
if (index2.value >= parent.columnNum) {
|
|
67
79
|
style.marginTop = pxCheck(parent.gutter);
|
|
68
80
|
}
|
|
69
81
|
}
|
|
@@ -79,7 +91,7 @@ const _sfc_main = create({
|
|
|
79
91
|
[`${prefixCls}--square`]: parent.square,
|
|
80
92
|
[`${prefixCls}--reverse`]: parent.reverse,
|
|
81
93
|
[`${prefixCls}--${parent.direction}`]: !!parent.direction,
|
|
82
|
-
[`${prefixCls}--clickable`]: parent.clickable
|
|
94
|
+
[`${prefixCls}--clickable`]: parent.clickable || props.to || props.url
|
|
83
95
|
};
|
|
84
96
|
});
|
|
85
97
|
const iconProps = computed(() => {
|
|
@@ -89,8 +101,14 @@ const _sfc_main = create({
|
|
|
89
101
|
color: props.iconColor || parent.iconColor
|
|
90
102
|
};
|
|
91
103
|
});
|
|
104
|
+
const router = useRouter();
|
|
92
105
|
const handleClick = (event) => {
|
|
93
106
|
emit("click", event);
|
|
107
|
+
if (props.to && router) {
|
|
108
|
+
router[props.replace ? "replace" : "push"](props.to);
|
|
109
|
+
} else if (props.url) {
|
|
110
|
+
props.replace ? location.replace(props.url) : location.href = props.url;
|
|
111
|
+
}
|
|
94
112
|
};
|
|
95
113
|
return {
|
|
96
114
|
rootClass,
|
|
@@ -127,5 +145,5 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
127
145
|
], 2)
|
|
128
146
|
], 6);
|
|
129
147
|
}
|
|
130
|
-
var
|
|
131
|
-
export {
|
|
148
|
+
var index = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]);
|
|
149
|
+
export { index as default };
|