refactor: ♻️ move nsfw functionality into root component
This commit is contained in:
parent
ae5d4d2633
commit
6823eeb92f
3 changed files with 18 additions and 22 deletions
|
@ -1,5 +1,5 @@
|
|||
<template>
|
||||
<nsfw-warning v-show="isWarn">
|
||||
<nsfw-warning v-show="$root.isWarn">
|
||||
<template #heading>
|
||||
⚠️⚠️⚠️<br />
|
||||
Whoa, Nelly!
|
||||
|
@ -15,14 +15,14 @@
|
|||
</nsfw-warning>
|
||||
|
||||
<prose>
|
||||
<nsfw-switch id="nsfw-switch" v-model="nsfw" @change="showWarning()" />
|
||||
<nsfw-switch id="nsfw-switch" v-model="$root.nsfw" @change="$root.showWarning()" />
|
||||
|
||||
<h2>Anatomy</h2>
|
||||
|
||||
<ref-figure>
|
||||
<template #img>
|
||||
<img
|
||||
v-if="nsfw"
|
||||
v-if="$root.nsfw"
|
||||
src="@/assets/refs/sebin-ref-body-NSFW.png"
|
||||
alt="Sebin Full Body Ref"
|
||||
/>
|
||||
|
@ -184,8 +184,8 @@
|
|||
</div>
|
||||
<nsfw-switch
|
||||
id="nsfw-switch-muscle"
|
||||
v-model="nsfw"
|
||||
@change="showWarning()"
|
||||
v-model="$root.nsfw"
|
||||
@change="$root.showWarning()"
|
||||
/>
|
||||
</div>
|
||||
</div> -->
|
||||
|
@ -339,21 +339,7 @@ export default {
|
|||
DataTable,
|
||||
RefGallery,
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
nsfw: false,
|
||||
isWarn: false,
|
||||
isConfirmedHorny: false,
|
||||
};
|
||||
},
|
||||
mixins: [Sebin, Helper],
|
||||
methods: {
|
||||
showWarning() {
|
||||
if (!this.isConfirmedHorny) {
|
||||
this.isWarn = true;
|
||||
}
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue