2021-12-30 00:44:43 +08:00
|
|
|
::: anchor
|
|
|
|
:::
|
|
|
|
|
2022-02-06 03:19:24 +08:00
|
|
|
::: title 基本介绍
|
|
|
|
:::
|
|
|
|
|
|
|
|
::: describe 通过鼠标或键盘输入内容,是最基础的表单域的包装。
|
|
|
|
:::
|
|
|
|
|
2021-10-26 01:13:23 +08:00
|
|
|
::: title 基础使用
|
2021-10-24 21:31:42 +08:00
|
|
|
:::
|
|
|
|
|
2022-02-01 23:26:28 +08:00
|
|
|
::: demo 使用 `lay-input` 标签, 创建输入框
|
2021-10-13 13:44:22 +08:00
|
|
|
|
|
|
|
<template>
|
|
|
|
<lay-input v-model="data1"></lay-input>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
<script>
|
|
|
|
import { ref } from 'vue'
|
|
|
|
|
|
|
|
export default {
|
|
|
|
setup() {
|
|
|
|
|
|
|
|
const data1 = ref("内容");
|
|
|
|
|
|
|
|
return {
|
|
|
|
data1
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
</script>
|
|
|
|
|
|
|
|
:::
|
|
|
|
|
2021-10-26 01:13:23 +08:00
|
|
|
::: title 提示信息
|
2021-10-24 21:31:42 +08:00
|
|
|
:::
|
|
|
|
|
2021-10-13 13:44:22 +08:00
|
|
|
::: demo
|
|
|
|
|
|
|
|
<template>
|
|
|
|
<lay-input placeholder="提示信息"></lay-input>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
<script>
|
|
|
|
import { ref } from 'vue'
|
|
|
|
|
|
|
|
export default {
|
|
|
|
setup() {
|
|
|
|
|
|
|
|
return {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
</script>
|
|
|
|
|
|
|
|
:::
|
|
|
|
|
2021-10-26 01:13:23 +08:00
|
|
|
::: title 事件回调
|
2021-10-24 21:31:42 +08:00
|
|
|
:::
|
|
|
|
|
2021-10-13 13:44:22 +08:00
|
|
|
::: demo
|
|
|
|
|
|
|
|
<template>
|
|
|
|
<lay-input v-model="data2" @input="input"></lay-input>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
<script>
|
|
|
|
import { ref } from 'vue'
|
|
|
|
|
|
|
|
export default {
|
|
|
|
setup() {
|
|
|
|
|
|
|
|
const data2 = ref("Input 事件");
|
|
|
|
const input = function( val ) {
|
|
|
|
console.log("当前值:" + val)
|
|
|
|
}
|
|
|
|
|
|
|
|
return {
|
|
|
|
data2,
|
|
|
|
input
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
</script>
|
|
|
|
|
2021-10-13 14:13:04 +08:00
|
|
|
:::
|
|
|
|
|
2021-10-26 01:13:23 +08:00
|
|
|
::: title 禁止输入
|
2021-10-24 21:31:42 +08:00
|
|
|
:::
|
2021-10-13 14:13:04 +08:00
|
|
|
|
2021-10-13 14:29:34 +08:00
|
|
|
::: demo
|
|
|
|
|
|
|
|
<template>
|
|
|
|
<lay-input placeholder="禁止输入" :disabled="disabled"></lay-input>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
<script>
|
|
|
|
import { ref } from 'vue'
|
|
|
|
|
|
|
|
export default {
|
|
|
|
setup() {
|
|
|
|
|
|
|
|
const disabled = ref(true)
|
|
|
|
|
|
|
|
return {
|
|
|
|
disabled
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
</script>
|
|
|
|
|
|
|
|
:::
|
|
|
|
|
2022-01-10 01:17:03 +08:00
|
|
|
::: title Input 属性
|
2021-10-24 21:31:42 +08:00
|
|
|
:::
|
2021-10-13 14:29:34 +08:00
|
|
|
|
2021-11-07 15:55:08 +08:00
|
|
|
::: table
|
|
|
|
|
2021-11-01 01:02:21 +08:00
|
|
|
| 属性 | 描述 | 可选值 |
|
|
|
|
| ----------- | ------------- | -------------- |
|
|
|
|
| name | 原始属性 name | -- |
|
|
|
|
| placeholder | 提示信息 | -- |
|
|
|
|
| disabled | 禁用 | `true` `false` |
|
|
|
|
| v-model | 值 | -- |
|
|
|
|
|
2021-11-07 15:55:08 +08:00
|
|
|
:::
|
|
|
|
|
2022-01-10 01:17:03 +08:00
|
|
|
::: title Input 属性
|
2021-11-01 01:02:21 +08:00
|
|
|
:::
|
|
|
|
|
2021-11-07 15:55:08 +08:00
|
|
|
::: table
|
|
|
|
|
2021-11-01 01:02:21 +08:00
|
|
|
| 事件 | 描述 | 参数 |
|
|
|
|
| ----- | --------------- | ---------------- |
|
|
|
|
| input | 原生 input 事件 | event : 事件对象 |
|
|
|
|
| foucs | 原生 foucs 事件 | event : 事件对象 |
|
|
|
|
| blur | 原生 blur 事件 | -- |
|
2021-11-07 15:55:08 +08:00
|
|
|
|
2021-11-07 15:56:24 +08:00
|
|
|
:::
|
2021-12-16 17:57:59 +08:00
|
|
|
|
|
|
|
::: comment
|
2022-01-12 14:19:06 +08:00
|
|
|
:::
|
|
|
|
|
|
|
|
::: previousNext input
|
2021-12-16 17:57:59 +08:00
|
|
|
:::
|