(button): 修正 button.md 文档

This commit is contained in:
就眠儀式 2022-11-04 02:13:03 +08:00
parent bbf0409262
commit c31f564c05
2 changed files with 18 additions and 17 deletions

View File

@ -17,11 +17,11 @@ export interface InputNumberProps {
name?: string;
disabled?: boolean;
disabledInput?: boolean;
size?: InputNumberSize;
step?: number;
position?: "right";
min?: number;
max?: number;
size?: InputNumberSize;
}
const props = withDefaults(defineProps<InputNumberProps>(), {
@ -61,8 +61,9 @@ watch(
}
}
);
const tempValue = ref(0);
let timer: any = 0;
const tempValue: Ref<number> = ref(0);
const minControl = computed(() => {
if (props.disabled) {
@ -120,8 +121,8 @@ const isNumber = function (num: any) {
<div class="layui-input-number" :position="position" :size="size">
<lay-button
size="lg"
@mousedown="longDown(subtraction)"
@mouseup="cancelLongDown"
@mousedown="longDown(subtraction)"
@blur="cancelLongDown"
:disabled="minControl"
class="layui-control-btn layui-subtraction-btn"
@ -134,20 +135,20 @@ const isNumber = function (num: any) {
</lay-button>
<div class="layui-input-number-input">
<lay-input
v-model="num"
type="number"
:readonly="disabledInput || disabled"
:disabled="disabledInput || disabled"
:max="max"
:min="min"
:name="name"
@change="inputChange"
v-model="num"
:readonly="disabledInput || disabled"
:disabled="disabledInput || disabled"
@input="inputChange"
type="number"
/>
</div>
<lay-button
size="lg"
@mousedown="longDown(addition)"
@mouseup="cancelLongDown"
@mousedown="longDown(addition)"
@blur="cancelLongDown"
:disabled="maxControl"
class="layui-control-btn layui-addition-btn"

View File

@ -122,10 +122,10 @@ export default {
::: demo 使用 `fluid` 属性, 使其适合父最大宽度
<template>
<lay-button type="primary" fluid="true">最大化按钮</lay-button>
<lay-button type="primary" fluid>最大化按钮</lay-button>
<br/>
<br/>
<lay-button type="default" fluid="true">最大化按钮</lay-button>
<lay-button type="default" fluid>最大化按钮</lay-button>
</template>
<script>
@ -148,12 +148,12 @@ export default {
::: demo 使用 `radius` 属性,创建圆角按钮
<template>
<lay-button type="primary" radius="true">原始按钮</lay-button>
<lay-button type="default" radius="true">默认按钮</lay-button>
<lay-button type="normal" radius="true">百搭按钮</lay-button>
<lay-button type="warm" radius="true">暖色按钮</lay-button>
<lay-button type="danger" radius="true">警告按钮</lay-button>
<lay-button disabled radius="true">禁用按钮</lay-button>
<lay-button type="primary" radius>原始按钮</lay-button>
<lay-button type="default" radius>默认按钮</lay-button>
<lay-button type="normal" radius>百搭按钮</lay-button>
<lay-button type="warm" radius>暖色按钮</lay-button>
<lay-button type="danger" radius>警告按钮</lay-button>
<lay-button disabled radius>禁用按钮</lay-button>
</template>
<script>