-
Notifications
You must be signed in to change notification settings - Fork 11
Expand file tree
/
Copy pathRequiredExample.vue
More file actions
34 lines (32 loc) · 1014 Bytes
/
RequiredExample.vue
File metadata and controls
34 lines (32 loc) · 1014 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
<script lang="ts">
import { defineComponent } from "vue";
import { FButton, FTextField, FValidationForm } from "@fkui/vue";
export default defineComponent({
name: "RequiredExample",
components: { FButton, FTextField, FValidationForm },
data() {
return { model: "" };
},
methods: {
onSubmit(): void {
alert("Spara");
},
onCancel(): void {
alert("Avbryt");
},
},
});
</script>
<template>
<f-validation-form :use-error-list="false" @submit="onSubmit">
<f-text-field v-model="model" v-validation.required> Fyll i minst ett tecken </f-text-field>
<div class="button-group">
<f-button id="submit" class="button-group__item" size="large" type="submit">
Spara
</f-button>
<f-button class="button-group__item" size="large" variant="secondary" @click="onCancel">
Avbryt
</f-button>
</div>
</f-validation-form>
</template>