diff --git a/components/WhereInput.vue b/components/WhereInput.vue index e9aefc74..0725e8a3 100644 --- a/components/WhereInput.vue +++ b/components/WhereInput.vue @@ -45,6 +45,7 @@ v-row.mb-4 :prepend-icon='mdiLink' :hint="$t('event.online_locations_help')" :label="$t('event.online_locations')" + :rules="[$validators.required('event.online_locations')]" clearable chips small-chips multiple deletable-chips hide-no-data hide-selected persistent-hint :delimiters="[',', ';', '; ']" :items="onlineLocations" diff --git a/plugins/validators.js b/plugins/validators.js index b693ba74..994928b5 100644 --- a/plugins/validators.js +++ b/plugins/validators.js @@ -4,7 +4,7 @@ export default ({ app }, inject) => { const $t = app.i18n.t.bind(app.i18n) const validators = { required (fieldName) { - return value => !!value || $t('validators.required', { fieldName: $t(fieldName) }) + return v => !(v===undefined || v===null || v.length <= 0) || $t('validators.required', { fieldName: $t(fieldName) }) }, email: [ v => !!v || $t('validators.required', { fieldName: $t('common.email') }),