finding solution for toggle button position

This commit is contained in:
2022-03-08 09:48:17 +01:00
parent d6933fce35
commit c611f35cd6
5 changed files with 24 additions and 40 deletions

View File

@@ -3,8 +3,8 @@
<div :class="{ 'blur': isBlurred }">
<slot name="confidential-content"></slot>
</div>
<div>
<i class="fa fa-eye toggle" :class="positionBtn" aria-hidden="true" @click="toggleBlur"></i>
<div class="toggle-container">
<i class="fa fa-eye toggle" :class="{ toggleIcon }" aria-hidden="true" @click="toggleBlur"></i>
</div>
</div>
</template>
@@ -12,28 +12,24 @@
<script>
export default {
name: "Confidential",
props: ['positionBtnFar'],
data() {
return {
isBlurred: true,
toggleIcon: 'fa-eye',
};
},
methods : {
toggleBlur() {
console.log(this.positionBtnFar);
this.isBlurred = !this.isBlurred;
this.toggleIcon = this.isBlurred ? 'fa-eye' : 'fa-eye-slash';
},
},
computed: {
positionBtn() {
return this.positionBtnFar ? 'toggle-far' : 'toggle-close'
}
}
}
</script>
<style scoped lang='scss'>
.confidential{
align-items: center;
align-content: center;
}
</style>