Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion packages/input/src/input.ts
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,10 @@ export default defineComponent({
type: [String, Number] as PropType<VxeInputPropTypes.Max>,
default: null
},
wheel: {
type: [String, Number] as PropType<VxeInputPropTypes.Max>,
default: () => getConfig().input.wheel ?? true
},
step: [String, Number] as PropType<VxeInputPropTypes.Step>,
trim: {
type: Boolean as PropType<VxeInputPropTypes.Trim>,
Expand Down Expand Up @@ -1295,7 +1299,7 @@ export default defineComponent({

const wheelEvent = (evnt: WheelEvent) => {
const isNumType = computeIsNumType.value
if (isNumType && props.controls) {
if (isNumType && props.controls && props.wheel) {
if (reactData.isActivated) {
const delta = evnt.deltaY
if (delta > 0) {
Expand Down
6 changes: 5 additions & 1 deletion packages/number-input/src/number-input.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,10 @@ export default defineComponent({
type: [String, Number] as PropType<VxeNumberInputPropTypes.Max>,
default: null
},
wheel: {
type: Boolean as PropType<VxeNumberInputPropTypes.Wheel>,
default: () => getConfig().numberInput.wheel ?? true
},
step: [String, Number] as PropType<VxeNumberInputPropTypes.Step>,
exponential: {
type: Boolean as PropType<VxeNumberInputPropTypes.Exponential>,
Expand Down Expand Up @@ -646,7 +650,7 @@ export default defineComponent({
wheelDelta: number;
}) => {
const inputReadonly = computeInputReadonly.value
if (props.controls && !inputReadonly) {
if (props.controls && !inputReadonly && props.wheel) {
if (reactData.isActivated) {
evnt.stopPropagation()
evnt.preventDefault()
Expand Down
2 changes: 2 additions & 0 deletions types/components/input.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ export namespace VxeInputPropTypes {
export type Form = string
export type Min = string | number
export type Max = string | number
export type Wheel = boolean
export type Step = string | number
export type Trim = boolean
export type Exponential = boolean
Expand Down Expand Up @@ -108,6 +109,7 @@ export interface VxeInputProps {
// number、integer、float
min?: VxeInputPropTypes.Min
max?: VxeInputPropTypes.Max
wheel?: VxeInputPropTypes.Wheel
step?: VxeInputPropTypes.Step
trim?: VxeInputPropTypes.Trim
exponential?: VxeInputPropTypes.Exponential
Expand Down
2 changes: 2 additions & 0 deletions types/components/number-input.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ export namespace VxeNumberInputPropTypes {
export type Form = string
export type Min = string | number
export type Max = string | number
export type Wheel = boolean
export type Step = string | number
export type Exponential = boolean
export type Controls = boolean
Expand Down Expand Up @@ -84,6 +85,7 @@ export interface VxeNumberInputProps {
// number、integer、float
min?: VxeNumberInputPropTypes.Min
max?: VxeNumberInputPropTypes.Max
wheel?: VxeNumberInputPropTypes.Wheel
step?: VxeNumberInputPropTypes.Step
exponential?: VxeNumberInputPropTypes.Exponential

Expand Down