Answer the question
In order to leave comments, you need to log in
How to change the style of an element in one component if the button was clicked in another component?
Who can suggest how to change the style of an element in one component if the button was clicked in another component?
Here is the button in the Aside component
a(href='#' @click='showMobileMenu = !showMobileMenu')
import { defineComponent } from 'vue'
export default defineComponent({
data () {
return {
showMobileMenu: false
}
},
<template lang="pug">
.asd
Nav
Section
</template>
<script lang="ts">
import { Options, Vue } from 'vue-class-component'
import Nav from '@/components/Nav.vue' // @ is an alias to /src
import Section from '@/components/Section.vue' // @ is an alias to /src
@Options({
components: {
Nav,
Section
}
})
export default class Home extends Vue {}
</script>
<style lang="scss">
</style>
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question