mirror of
https://github.com/Bubka/2FAuth.git
synced 2024-11-27 02:36:06 +01:00
50 lines
1.1 KiB
Vue
50 lines
1.1 KiB
Vue
|
<template>
|
||
|
<div class="field">
|
||
|
<label class="label" v-html="label"></label>
|
||
|
<div class="control">
|
||
|
<input :id="fieldName" :type="inputType" class="input" v-model="form[fieldName]" :placeholder="placeholder" v-bind="$attrs" />
|
||
|
</div>
|
||
|
<field-error :form="form" :field="fieldName" />
|
||
|
</div>
|
||
|
</template>
|
||
|
|
||
|
<script>
|
||
|
export default {
|
||
|
name: 'FormField',
|
||
|
inheritAttrs: false,
|
||
|
|
||
|
data() {
|
||
|
return {
|
||
|
|
||
|
}
|
||
|
},
|
||
|
|
||
|
props: {
|
||
|
label: {
|
||
|
type: String,
|
||
|
default: ''
|
||
|
},
|
||
|
|
||
|
fieldName: {
|
||
|
type: String,
|
||
|
default: '',
|
||
|
required: true
|
||
|
},
|
||
|
|
||
|
inputType: {
|
||
|
type: String,
|
||
|
default: 'text'
|
||
|
},
|
||
|
|
||
|
form: {
|
||
|
type: Object,
|
||
|
required: true
|
||
|
},
|
||
|
|
||
|
placeholder: {
|
||
|
type: String,
|
||
|
default: ''
|
||
|
},
|
||
|
}
|
||
|
}
|
||
|
</script>
|