阻止输入框的默认事件
parent
36d3d07c8d
commit
96157a7cc2
|
|
@ -2,7 +2,7 @@
|
||||||
<template>
|
<template>
|
||||||
<div class="input-number" :class="iconName ? 'has-icon' : ''">
|
<div class="input-number" :class="iconName ? 'has-icon' : ''">
|
||||||
<icon v-if="iconName" :name="iconName" size="14" color="3" class="input-icon"></icon>
|
<icon v-if="iconName" :name="iconName" size="14" color="3" class="input-icon"></icon>
|
||||||
<el-input-number v-model="internal_value" :min="min" :max="max" type="number" placeholder="0" controls-position="right"></el-input-number>
|
<el-input-number v-model="internal_value" :min="min" :max="max" type="number" placeholder="0" controls-position="right" @keyup.enter="preventDefault"></el-input-number>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
|
|
@ -22,6 +22,10 @@ const props = defineProps({
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
const internal_value = defineModel({ type: Number, default: 0 });
|
const internal_value = defineModel({ type: Number, default: 0 });
|
||||||
|
// 阻止默认点击事件
|
||||||
|
const preventDefault = (e: DragEvent) => {
|
||||||
|
e.preventDefault();
|
||||||
|
}
|
||||||
</script>
|
</script>
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
.input-number {
|
.input-number {
|
||||||
|
|
|
||||||
|
|
@ -186,14 +186,6 @@ const props = defineProps({
|
||||||
const diy_data = ref(props.diyData);
|
const diy_data = ref(props.diyData);
|
||||||
const page_data = ref(props.header);
|
const page_data = ref(props.header);
|
||||||
const footer_nav = ref(props.footer);
|
const footer_nav = ref(props.footer);
|
||||||
const drawer_visiable = ref(false);
|
|
||||||
watch(diy_data, (val) => {
|
|
||||||
if (val.length > 0) {
|
|
||||||
drawer_visiable.value = true;
|
|
||||||
} else {
|
|
||||||
drawer_visiable.value = false;
|
|
||||||
}
|
|
||||||
})
|
|
||||||
// 监听
|
// 监听
|
||||||
watch(
|
watch(
|
||||||
() => props.diyData,
|
() => props.diyData,
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue