Vuex modular Map auxiliary function
- The helper function is used to deconstruct the vuex method into the component directly to this. Method name use
- Import {mapState, mapMutations, mapGetters, mapActions} from “vuex”;
- To use this deconstructed method, you need to specify the name of your modular component, such as… mapState(“modA”, [“modaStr”]),
- There are three ways to deconstruct mapState, arrays directly and the easiest way to deconstruct it is properties so it expands in computed
- MapGetters two methods of deconstruction
- MapMutations two methods of deconstruction are deconstructed out of the method so extended in methds
- mapActions
2 with mixins
- First, there is a folder with minda.js. Methods and data in the mindb. js file are for public use. When you open a page, you will first execute it
- The component uses this to blend in the methods that are introduced into the file
- Global blending, in main. It is recommended not to affect the component
Vuex introduces rotation
-
Step 1: Install dependencies NPM I swiper@5 –save NPM I vue-awesome-swiper@3 –save
-
The second global main.js is introduced
import VueAwesomeSwiper from "vue-awesome-swiper"; import "swiper/css/swiper.css"; Vue.use(VueAwesomeSwiper); Copy the codeCopy the code
-
The third part: on the page to write round cast page