This commit is contained in:
2025-08-06 16:35:47 +08:00
commit 03467cbb70
180 changed files with 30810 additions and 0 deletions

View File

@@ -0,0 +1,34 @@
<template>
<input
class="filter_input"
type="number"
:value="value"
:placeholder="placeholder"
@input="onInput"
@confirm="onInput"
/>
</template>
<script>
export default {
props: {
value: {
type: [Number, String],
default: '',
},
placeholder: String
},
methods: {
onInput(event) {
// 获取输入值
const value = event.detail ? event.detail.value : event.target.value;
// 格式化输入值
let formattedValue = value.replace(/[^0-9.]/g, '')
formattedValue = parseFloat(formattedValue)
formattedValue = formattedValue > 0 ? formattedValue : ''
this.$emit('input', formattedValue);
event.target.value = formattedValue
}
},
};
</script>