Skip to content
On this page

Input

TIP

默认数字类型,一般用于金额类型,默认小数点后两位

基础使用

vue
<template>
  <div class="width-240">
    <k-input placeholder="请输入金额" v-model="value" />
  </div>
</template>

<script setup>
import { ref } from 'vue';

const value = ref('');
</script>

整数类型

如果设置typeinteger类型,输入框只能输入整数

vue
<template>
  <div class="width-240">
    <k-input type="integer" placeholder="请输入整数类型" v-model="value" />
  </div>
</template>

<script setup>
import { ref } from 'vue';

const value = ref('');
</script>

控制小数点

如果设置point属性,可控制小数点后几位,默认为小数点后两位

vue
<template>
  <div class="width-240">
    <k-input :point="3" placeholder="可输入小数点后3位" v-model="value" />
  </div>
</template>

<script setup>
import { ref } from 'vue';

const value = ref('');
</script>

Input 属性

Input 事件