refactor: ♻️ move v-model up one layer
This commit is contained in:
parent
724dd3bca2
commit
80be636384
2 changed files with 12 additions and 3 deletions
|
@ -5,7 +5,7 @@
|
|||
<div>
|
||||
If you wish to see NSFW content on this page flip this switch.
|
||||
</div>
|
||||
<nsfw-switch />
|
||||
<nsfw-switch v-model="$parent.nsfw" />
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
|
|
@ -3,7 +3,8 @@
|
|||
<div>😇</div>
|
||||
<div class="toggle-wrap">
|
||||
<input
|
||||
v-model="$parent.$parent.nsfw"
|
||||
:checked="checked"
|
||||
@change="$emit('change', $event.target.checked)"
|
||||
type="checkbox"
|
||||
name="nsfw"
|
||||
id="nsfw-switch"
|
||||
|
@ -15,7 +16,15 @@
|
|||
</template>
|
||||
|
||||
<script>
|
||||
export default {};
|
||||
export default {
|
||||
model: {
|
||||
prop: "checked",
|
||||
event: "change"
|
||||
},
|
||||
props: {
|
||||
checked: Boolean
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue