Achievement effect: Click the button to switch the width of the left menu.
I have now used Vuex to store a field IsOpen, and then both the nav component and the menu component have obtained the initial value of the field, and they also switch when the nav component button is clicked. The value of IsOpen, but the class name that changes the width is not switched.
This is the code for nav formation:
This is the code of the menu component:
import { mapGetters } from 'vuex'
export {
}
Write the code to switch styles in the getters file of the warehouse
Please read the vuex documentation carefully
You can directly bind vuex data to your tags