-
zhangwei
2025-03-06 8c047f7da19d7e59136a322e1a851d4b6b0eab97
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
import { defineMixin } from '../../libs/vue'
import defProps from '../../libs/config/props.js'
export const props = defineMixin({
    props: {
        // 步进器标识符,在change回调返回
        name: {
            type: [String, Number],
            default: () => defProps.numberBox.name
        },
        // #ifdef VUE2
        // 用于双向绑定的值,初始化时设置设为默认min值(最小值)
        value: {
            type: [String, Number],
            default: () => defProps.numberBox.value
        },
        // #endif
        // #ifdef VUE3
        // 用于双向绑定的值,初始化时设置设为默认min值(最小值)
        modelValue: {
            type: [String, Number],
            default: () => defProps.numberBox.value
        },
        // #endif
        // 最小值
        min: {
            type: [String, Number],
            default: () => defProps.numberBox.min
        },
        // 最大值
        max: {
            type: [String, Number],
            default: () => defProps.numberBox.max
        },
        // 加减的步长,可为小数
        step: {
            type: [String, Number],
            default: () => defProps.numberBox.step
        },
        // 是否只允许输入整数
        integer: {
            type: Boolean,
            default: () => defProps.numberBox.integer
        },
        // 是否禁用,包括输入框,加减按钮
        disabled: {
            type: Boolean,
            default: () => defProps.numberBox.disabled
        },
        // 是否禁用输入框
        disabledInput: {
            type: Boolean,
            default: () => defProps.numberBox.disabledInput
        },
        // 是否开启异步变更,开启后需要手动控制输入值
        asyncChange: {
            type: Boolean,
            default: () => defProps.numberBox.asyncChange
        },
        // 输入框宽度,单位为px
        inputWidth: {
            type: [String, Number],
            default: () => defProps.numberBox.inputWidth
        },
        // 是否显示减少按钮
        showMinus: {
            type: Boolean,
            default: () => defProps.numberBox.showMinus
        },
        // 是否显示增加按钮
        showPlus: {
            type: Boolean,
            default: () => defProps.numberBox.showPlus
        },
        // 显示的小数位数
        decimalLength: {
            type: [String, Number, null],
            default: () => defProps.numberBox.decimalLength
        },
        // 是否开启长按加减手势
        longPress: {
            type: Boolean,
            default: () => defProps.numberBox.longPress
        },
        // 输入框文字和加减按钮图标的颜色
        color: {
            type: String,
            default: () => defProps.numberBox.color
        },
        // 按钮宽度
        buttonWidth: {
            type: [String, Number],
            default: () => defProps.numberBox.buttonWidth
        },
        // 按钮大小,宽高等于此值,单位px,输入框高度和此值保持一致
        buttonSize: {
            type: [String, Number],
            default: () => defProps.numberBox.buttonSize
        },
        // 按钮圆角
        buttonRadius: {
            type: [String],
            default: () => defProps.numberBox.buttonRadius
        },
        // 输入框和按钮的背景颜色
        bgColor: {
            type: String,
            default: () => defProps.numberBox.bgColor
        },
        // 输入框背景颜色
        inputBgColor: {
            type: String,
            default: () => defProps.numberBox.inputBgColor
        },
        // 指定光标于键盘的距离,避免键盘遮挡输入框,单位px
        cursorSpacing: {
            type: [String, Number],
            default: () => defProps.numberBox.cursorSpacing
        },
        // 是否禁用增加按钮
        disablePlus: {
            type: Boolean,
            default: () => defProps.numberBox.disablePlus
        },
        // 是否禁用减少按钮
        disableMinus: {
            type: Boolean,
            default: () => defProps.numberBox.disableMinus
        },
        // 加减按钮图标的样式
        iconStyle: {
            type: [Object, String],
            default: () => defProps.numberBox.iconStyle
        },
        // 迷你模式
        miniMode: {
            type: Boolean,
            default: () => defProps.numberBox.miniMode
        },
    }
})