1
0
Fork 0
mirror of https://gitlab.com/bramw/baserow.git synced 2025-04-05 21:55:24 +00:00
bramw_baserow/web-frontend/modules/database/components/table/TableForm.vue

50 lines
971 B
Vue

<template>
<form @submit.prevent="submit">
<div class="control">
<label class="control-label">
<i class="fas fa-font"></i>
Name
</label>
<div class="control-elements">
<input
ref="name"
v-model="values.name"
:class="{ 'input-error': $v.values.name.$error }"
type="text"
class="input input-large"
@blur="$v.values.name.$touch()"
/>
<div v-if="$v.values.name.$error" class="error">
This field is required.
</div>
</div>
</div>
<slot></slot>
</form>
</template>
<script>
import { required } from 'vuelidate/lib/validators'
import form from '@/mixins/form'
export default {
name: 'TableForm',
mixins: [form],
data() {
return {
values: {
name: ''
}
}
},
validations: {
values: {
name: { required }
}
},
mounted() {
this.$refs.name.focus()
}
}
</script>