【revuekitz】NumberField
■ コンポーネントデモ(demo)
100
■ 概要(overview)
コンポーネント名
- NumberField
レベル (Atomic Design)
- Atoms(原子)
カテゴリー(category)
- fields
■ データ(data)
【reactive/ref】
value
(number): 入力された数値を保持します。
【props】
id
(string): 数値入力フィールドのHTML要素のID属性class
(string): 数値入力フィールドに適用される追加のCSSクラスstyle
(string): 数値入力フィールドに適用されるインラインスタイルstyleReset
(boolean): スタイルをリセットするかどうかを示すフラグname
(string): 数値入力フィールドのHTML要素のname属性number
(number): 数値入力フィールドの初期値min
(string|number): 数値入力フィールドで許容される最小値max
(string|number): 数値入力フィールドで許容される最大値isDisabled
(boolean): 数値入力フィールドが無効化されているかどうかを示すフラグisReadonly
(boolean): 数値入力フィールドが読み取り専用であるかどうかを示すフラグ
【emit】
update:modelValue
: 数値が変更されたときに発行されるイベント
【computed】
bindingClass
:styleReset
がtrue
の場合はprops.class
を返し、それ以外の場合はrevuekitz-number-field ${props.class}
をクラス名として返す
■ 使用例(usecase)
<script setup>
import { NumberField } from 'revuekitz'
import 'revuekitz/dist/style.css'
import { ref } from 'vue'
const numberValue = ref(100)
</script>
<template>
<NumberField
id="numberFieldId"
class="number-field-class"
:style="{ backgroundColor: '#f0f0f0', border: '1px solid #ccc' }"
name="number_field_name"
:min="0"
:max="7000"
:isDisabled="false"
:isReadonly="false"
v-model="numberValue"
/>
</template>