d0dd1ea473
Change-Id: I6b84399995ed28e9fe098abe38465ed5d685fb47
48 lines
770 B
Vue
48 lines
770 B
Vue
<template>
|
|
<article>
|
|
<veui-form
|
|
:data="formData"
|
|
>
|
|
<veui-field
|
|
label="名称:"
|
|
name="name"
|
|
:rules="[{ name: 'required', triggers: 'input,blur' }]"
|
|
>
|
|
<template #default="{ invalid, listeners }">
|
|
<input
|
|
:class="{
|
|
'demo-invalid': invalid
|
|
}"
|
|
v-model="formData.name"
|
|
v-on="listeners"
|
|
>
|
|
</template>
|
|
</veui-field>
|
|
</veui-form>
|
|
</article>
|
|
</template>
|
|
|
|
<script>
|
|
import { Form, Field } from 'veui'
|
|
|
|
export default {
|
|
components: {
|
|
'veui-form': Form,
|
|
'veui-field': Field
|
|
},
|
|
data () {
|
|
return {
|
|
formData: {
|
|
name: ''
|
|
}
|
|
}
|
|
}
|
|
}
|
|
</script>
|
|
|
|
<style lang="less" scoped>
|
|
.demo-invalid {
|
|
border: 1px solid #cc1800;
|
|
}
|
|
</style>
|