mirror of
https://github.com/Bubka/2FAuth.git
synced 2025-06-12 07:56:50 +02:00
Add IsDisabled prop to FormToggle component
This commit is contained in:
parent
b8180e3abf
commit
6aa0134818
@ -2,7 +2,7 @@
|
|||||||
<div class="field" :class="{ 'with-offset' : hasOffset }">
|
<div class="field" :class="{ 'with-offset' : hasOffset }">
|
||||||
<label class="label" v-html="label"></label>
|
<label class="label" v-html="label"></label>
|
||||||
<div class="is-toggle buttons">
|
<div class="is-toggle buttons">
|
||||||
<a class="button is-dark" v-for="choice in choices" :class="{ 'is-link' : form[fieldName] === choice }" @click="form[fieldName] = choice">{{ choice }}</a>
|
<a class="button is-dark" :disabled="isDisabled" v-for="choice in choices" :class="{ 'is-link' : form[fieldName] === choice }" @click="setField(choice)">{{ choice }}</a>
|
||||||
</div>
|
</div>
|
||||||
<field-error :form="form" :field="fieldName" />
|
<field-error :form="form" :field="fieldName" />
|
||||||
<p class="help" v-html="help" v-if="help"></p>
|
<p class="help" v-html="help" v-if="help"></p>
|
||||||
@ -49,7 +49,22 @@
|
|||||||
hasOffset: {
|
hasOffset: {
|
||||||
type: Boolean,
|
type: Boolean,
|
||||||
default: false
|
default: false
|
||||||
|
},
|
||||||
|
|
||||||
|
isDisabled: {
|
||||||
|
type: Boolean,
|
||||||
|
default: false
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
methods: {
|
||||||
|
|
||||||
|
setField(value) {
|
||||||
|
if( !this.isDisabled ) {
|
||||||
|
this.form[this.fieldName] = value
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
Loading…
x
Reference in New Issue
Block a user