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