2021-10-26 01:13:23 +08:00
|
|
|
::: title 基础使用
|
2021-09-28 12:41:16 +08:00
|
|
|
:::
|
|
|
|
|
|
|
|
::: demo
|
|
|
|
|
|
|
|
<template>
|
2021-10-20 00:17:51 +08: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 15:01:12 +08:00
|
|
|
</template>
|
|
|
|
|
|
|
|
<script>
|
2021-10-20 00:17:51 +08:00
|
|
|
import { ref, reactive } from 'vue'
|
2021-09-28 15:01:12 +08:00
|
|
|
|
|
|
|
export default {
|
|
|
|
setup() {
|
|
|
|
|
2021-10-20 00:17:51 +08:00
|
|
|
const model = reactive({
|
|
|
|
username: "admin",
|
|
|
|
password: "admin"
|
|
|
|
})
|
2021-09-28 15:01:12 +08:00
|
|
|
|
2021-10-20 00:17:51 +08:00
|
|
|
const submit = function(val) {
|
|
|
|
alert(JSON.stringify(val))
|
2021-09-28 15:01:12 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
return {
|
2021-10-20 00:17:51 +08:00
|
|
|
model,
|
|
|
|
submit
|
2021-09-28 15:01:12 +08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
</script>
|
|
|
|
|
2021-09-30 01:44:02 +08:00
|
|
|
:::
|
|
|
|
|
2021-10-26 01:13:23 +08:00
|
|
|
::: title 表单事件
|
2021-09-30 01:44:02 +08:00
|
|
|
:::
|
|
|
|
|
2021-11-07 15:55:08 +08:00
|
|
|
::: table
|
|
|
|
|
2021-10-26 01:14:17 +08:00
|
|
|
| Name | Description | Accepted Values |
|
|
|
|
| ----- | ----------- | --------------- |
|
|
|
|
| model | 表单绑定值 | -- |
|
2021-09-30 01:44:02 +08:00
|
|
|
|
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
|
|
|
:::
|