💄(input): 修正 input 组件格式

This commit is contained in:
就眠儀式 2022-05-06 14:52:26 +08:00
parent 02c01b5944
commit eb2ed1001f
2 changed files with 6 additions and 5 deletions

View File

@ -31,7 +31,7 @@ const props = withDefaults(defineProps<LayInputProps>(), {
readonly: false,
allowClear: false,
autofocus: false,
autocomplete: false
autocomplete: false,
});
const emit = defineEmits([
@ -78,13 +78,13 @@ const onBlur = () => {
:placeholder="placeholder"
:autofocus="autofocus"
:autocomplete="autocomplete"
:readonly="readonly"
:class="{ 'layui-disabled': disabled }"
class="layui-input"
@input="onInput"
@focus="onFocus"
@blur="onBlur"
@change="onChange"
:readonly="props.readonly"
/>
<span class="layui-input-suffix" v-if="slots.suffix">
<slot name="suffix"></slot>

View File

@ -5,10 +5,10 @@ export default {
</script>
<script setup lang="ts">
import layButton from "../button/index.vue";
import "./index.less";
import layInput from "../input/index.vue";
import { LayIcon } from "@layui/icons-vue";
import "./index.less";
import layButton from "../button/index.vue";
import { ref, watch, withDefaults, computed } from "vue";
export interface LayInputNumberProps {
@ -65,6 +65,7 @@ let timer: any = 0;
const minControl = computed(
() => props.min !== -Infinity && Number(props.min) >= num.value
);
const maxControl = computed(
() => props.max !== Infinity && Number(props.max) <= num.value
);