docs_vue2/one/docs/demo/form/normal.vue

75 lines
1.3 KiB
Vue
Raw Normal View History

2020-08-13 11:47:56 +08:00
<template>
<article>
2022-03-31 13:24:57 +08:00
<veui-form
:data="formData"
@submit="handleSubmit"
>
<veui-field label="型号">
2020-08-13 11:47:56 +08:00
<veui-select
2022-03-31 13:24:57 +08:00
v-model="formData.model"
:options="models"
2020-08-13 11:47:56 +08:00
/>
</veui-field>
2022-03-31 13:24:57 +08:00
<veui-field label="日期">
<veui-date-picker
v-model="formData.date"
2020-08-13 11:47:56 +08:00
/>
</veui-field>
<template #actions>
<veui-button
ui="primary"
type="submit"
>
提交
</veui-button>
<veui-button>取消</veui-button>
</template>
</veui-form>
</article>
</template>
<script>
2022-03-31 13:24:57 +08:00
import { Form, Field, Button, Select, DatePicker } from 'veui'
2020-08-13 11:47:56 +08:00
export default {
components: {
'veui-form': Form,
'veui-field': Field,
'veui-button': Button,
'veui-select': Select,
2022-03-31 13:24:57 +08:00
'veui-date-picker': DatePicker
2020-08-13 11:47:56 +08:00
},
data () {
return {
2022-03-31 13:24:57 +08:00
models: [
2020-08-13 11:47:56 +08:00
{
2022-03-31 13:24:57 +08:00
label: 'APTX-4867',
value: 'aptx-4867'
2020-08-13 11:47:56 +08:00
},
{
2022-03-31 13:24:57 +08:00
label: 'APTX-4868',
value: 'aptx-4868'
2020-08-13 11:47:56 +08:00
},
{
2022-03-31 13:24:57 +08:00
label: 'APTX-4869',
value: 'aptx-4869'
2020-08-13 11:47:56 +08:00
},
{
2022-03-31 13:24:57 +08:00
label: 'APTX-4870',
value: 'aptx-4870'
2020-08-13 11:47:56 +08:00
}
],
formData: {
2022-03-31 13:24:57 +08:00
model: null,
date: null
2020-08-13 11:47:56 +08:00
}
}
2022-03-31 13:24:57 +08:00
},
methods: {
handleSubmit (data) {
this.$toast(JSON.stringify(data, null, 2))
}
2020-08-13 11:47:56 +08:00
}
}
</script>