uni.navigateTo({url:"/pages/2/2",animationType: 'zoom-out',animationDuration: 200})
Uniapp 页面跳转动画 只在App上生效
uniapp内置了vuex,不用下载,只要在根目录下新建 store>index.js, 然后在main.js里面引入
import store from '@/store/index.js'Vue.prototype.$store = store
然后再在index.js里面写上vuex的基本代码:
import Vue from 'vue'import Vuex from 'vuex'Vue.use(Vuex)const store = new Vuex.Store({state: {title:"1234"},mutations: {//相当于同步的操作},actions: {//相当于异步的操作,不能直接改变state的值,只能通过触发mutations的方法才能改变}})export default store
剩下的vuex用法就和vue2一样了。
文章评论