layui/example/docs/zh-CN/components/form.md

79 lines
1.3 KiB
Markdown
Raw Normal View History

2021-10-26 01:13:23 +08:00
::: title 基础使用
2021-09-28 12:41:16 +08:00
:::
::: demo
<template>
<lay-form @submit="submit" :model="model">
<lay-form-item label="账户">
<lay-input v-model="model.username"></lay-input>
</lay-form-item>
<lay-form-item label="密码">
<lay-input v-model="model.password"></lay-input>
</lay-form-item>
<lay-form-item>
<lay-button naive-type="submit">提交</lay-button>
</lay-form-item>
</lay-form>
</template>
<script>
import { ref, reactive } from 'vue'
export default {
setup() {
const model = reactive({
username: "admin",
password: "admin"
})
const submit = function(val) {
alert(JSON.stringify(val))
}
return {
model,
submit
}
}
}
</script>
:::
2021-10-26 01:13:23 +08:00
::: title 表单事件
:::
2021-11-07 15:55:08 +08:00
::: table
2021-10-26 01:14:17 +08:00
| Name | Description | Accepted Values |
| ----- | ----------- | --------------- |
| model | 表单绑定值 | -- |
2021-11-07 15:55:08 +08:00
:::
2021-10-26 01:13:23 +08:00
::: title 表单事件
2021-09-30 02:31:50 +08:00
:::
2021-11-07 15:55:08 +08:00
::: table
2021-10-26 01:14:17 +08:00
| Name | Description | Accepted Values |
| ------ | ----------- | --------------- |
| submit | 提交事件 | -- |
2021-09-30 02:31:50 +08:00
2021-11-07 15:55:08 +08:00
:::
2021-10-26 01:13:23 +08:00
::: title 表单项属性
2021-10-02 00:05:59 +08:00
:::
2021-11-07 15:55:08 +08:00
::: table
2021-10-26 01:14:17 +08:00
| Name | Description | Accepted Values |
| ----- | ----------- | --------------- |
| label | 标题名称 | -- |
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
:::