perf(input): input 组件新增 disabled 属性, 支持禁用
This commit is contained in:
@@ -4,7 +4,9 @@
|
||||
:value="modelValue"
|
||||
:placeholder="placeholder"
|
||||
:name="name"
|
||||
:disabled="disabled"
|
||||
class="layui-input"
|
||||
:class="{ 'layui-disabled': disabled }"
|
||||
@input="updateValue"
|
||||
/>
|
||||
</template>
|
||||
@@ -12,14 +14,16 @@
|
||||
<script setup name="LayInput" lang="ts">
|
||||
import { defineProps, defineEmits } from 'vue'
|
||||
|
||||
const props = defineProps<{
|
||||
name?: string
|
||||
type?: string
|
||||
modelValue?: string
|
||||
placeholder?: string
|
||||
}>()
|
||||
const props =
|
||||
defineProps<{
|
||||
name?: string
|
||||
type?: string
|
||||
modelValue?: string
|
||||
placeholder?: string
|
||||
disabled?: Boolean
|
||||
}>()
|
||||
|
||||
const emit = defineEmits(['update:modelValue','input'])
|
||||
const emit = defineEmits(['update:modelValue', 'input'])
|
||||
|
||||
const updateValue = function (event: InputEvent) {
|
||||
const inputElement = event.target as HTMLInputElement
|
||||
|
||||
Reference in New Issue
Block a user