mirror of
https://github.com/Bubka/2FAuth.git
synced 2025-06-19 03:16:49 +02:00
New FormSwitch vue component
This commit is contained in:
parent
03dc14034f
commit
d345c80d4d
43
resources/js/components/FormSwitch.vue
Normal file
43
resources/js/components/FormSwitch.vue
Normal file
@ -0,0 +1,43 @@
|
|||||||
|
<template>
|
||||||
|
<div class="field">
|
||||||
|
<label for="fieldName" class="label" v-html="label"></label>
|
||||||
|
<input id="fieldName" type="checkbox" name="fieldName" class="switch is-thin is-info" v-model="form[fieldName]">
|
||||||
|
<label for="fieldName" class="label"></label>
|
||||||
|
<p class="help" v-html="help" v-if="help"></p>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
export default {
|
||||||
|
name: 'FormSwitch',
|
||||||
|
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
props: {
|
||||||
|
label: {
|
||||||
|
type: String,
|
||||||
|
default: ''
|
||||||
|
},
|
||||||
|
|
||||||
|
fieldName: {
|
||||||
|
type: String,
|
||||||
|
default: '',
|
||||||
|
required: true
|
||||||
|
},
|
||||||
|
|
||||||
|
form: {
|
||||||
|
type: Object,
|
||||||
|
required: true
|
||||||
|
},
|
||||||
|
|
||||||
|
help: {
|
||||||
|
type: String,
|
||||||
|
default: ''
|
||||||
|
},
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
2
resources/js/components/index.js
vendored
2
resources/js/components/index.js
vendored
@ -4,6 +4,7 @@ import FieldError from './FieldError'
|
|||||||
import FormWrapper from './FormWrapper'
|
import FormWrapper from './FormWrapper'
|
||||||
import FormField from './FormField'
|
import FormField from './FormField'
|
||||||
import FormSelect from './FormSelect'
|
import FormSelect from './FormSelect'
|
||||||
|
import FormSwitch from './FormSwitch'
|
||||||
import FormButtons from './FormButtons'
|
import FormButtons from './FormButtons'
|
||||||
import VueFooter from './Footer'
|
import VueFooter from './Footer'
|
||||||
|
|
||||||
@ -14,6 +15,7 @@ import VueFooter from './Footer'
|
|||||||
FormWrapper,
|
FormWrapper,
|
||||||
FormField,
|
FormField,
|
||||||
FormSelect,
|
FormSelect,
|
||||||
|
FormSwitch,
|
||||||
FormButtons,
|
FormButtons,
|
||||||
VueFooter,
|
VueFooter,
|
||||||
].forEach(Component => {
|
].forEach(Component => {
|
||||||
|
1
resources/sass/app.scss
vendored
1
resources/sass/app.scss
vendored
@ -8,6 +8,7 @@
|
|||||||
//@import '~bootstrap/scss/bootstrap';
|
//@import '~bootstrap/scss/bootstrap';
|
||||||
@import '~bulma';
|
@import '~bulma';
|
||||||
@import '~bulma-checkradio';
|
@import '~bulma-checkradio';
|
||||||
|
@import '~bulma-switch';
|
||||||
|
|
||||||
a:hover {
|
a:hover {
|
||||||
color: hsl(204, 86%, 53%);
|
color: hsl(204, 86%, 53%);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user