2021-10-25 17:13:23 +00:00
|
|
|
::: title 基础使用
|
2021-09-28 04:41:16 +00:00
|
|
|
:::
|
|
|
|
|
|
|
|
::: demo
|
|
|
|
|
|
|
|
<template>
|
2021-10-19 16:17:51 +00:00
|
|
|
<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>
|
2021-09-28 07:01:12 +00:00
|
|
|
</template>
|
|
|
|
|
|
|
|
<script>
|
2021-10-19 16:17:51 +00:00
|
|
|
import { ref, reactive } from 'vue'
|
2021-09-28 07:01:12 +00:00
|
|
|
|
|
|
|
export default {
|
|
|
|
setup() {
|
|
|
|
|
2021-10-19 16:17:51 +00:00
|
|
|
const model = reactive({
|
|
|
|
username: "admin",
|
|
|
|
password: "admin"
|
|
|
|
})
|
2021-09-28 07:01:12 +00:00
|
|
|
|
2021-10-19 16:17:51 +00:00
|
|
|
const submit = function(val) {
|
|
|
|
alert(JSON.stringify(val))
|
2021-09-28 07:01:12 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
return {
|
2021-10-19 16:17:51 +00:00
|
|
|
model,
|
|
|
|
submit
|
2021-09-28 07:01:12 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
</script>
|
|
|
|
|
2021-09-29 17:44:02 +00:00
|
|
|
:::
|
|
|
|
|
2021-10-25 17:13:23 +00:00
|
|
|
::: title 表单事件
|
2021-09-29 17:44:02 +00:00
|
|
|
:::
|
|
|
|
|
2021-11-07 07:55:08 +00:00
|
|
|
::: table
|
|
|
|
|
2021-10-25 17:14:17 +00:00
|
|
|
| Name | Description | Accepted Values |
|
|
|
|
| ----- | ----------- | --------------- |
|
|
|
|
| model | 表单绑定值 | -- |
|
2021-09-29 17:44:02 +00:00
|
|
|
|
2021-11-07 07:55:08 +00:00
|
|
|
:::
|
|
|
|
|
2021-10-25 17:13:23 +00:00
|
|
|
::: title 表单事件
|
2021-09-29 18:31:50 +00:00
|
|
|
:::
|
|
|
|
|
2021-11-07 07:55:08 +00:00
|
|
|
::: table
|
|
|
|
|
2021-10-25 17:14:17 +00:00
|
|
|
| Name | Description | Accepted Values |
|
|
|
|
| ------ | ----------- | --------------- |
|
|
|
|
| submit | 提交事件 | -- |
|
2021-09-29 18:31:50 +00:00
|
|
|
|
2021-11-07 07:55:08 +00:00
|
|
|
:::
|
|
|
|
|
2021-10-25 17:13:23 +00:00
|
|
|
::: title 表单项属性
|
2021-10-01 16:05:59 +00:00
|
|
|
:::
|
|
|
|
|
2021-11-07 07:55:08 +00:00
|
|
|
::: table
|
|
|
|
|
2021-10-25 17:14:17 +00:00
|
|
|
| Name | Description | Accepted Values |
|
|
|
|
| ----- | ----------- | --------------- |
|
|
|
|
| label | 标题名称 | -- |
|
2021-11-07 07:55:08 +00:00
|
|
|
|
2021-11-07 07:56:24 +00:00
|
|
|
:::
|