- 移除秒合约页面及UI - 合约页Tab改为Position Held/Transaction Record - 存款/提款/转账页增加BTC/ETH - 资产页重构(用户信息+盈亏+多语言) - 注册页改版(匹配新设计稿) - 日文全面翻译+首页菜单多语言 - 代理专属注册链接支持(?code=) - 10个locale文件同步更新
33 lines
880 B
JavaScript
33 lines
880 B
JavaScript
import Vue from 'vue'
|
|
import Vuex from 'vuex'
|
|
import {darkTheme,lightTheme} from '@/components/theme/theme.js'
|
|
Vue.use(Vuex)
|
|
const store = new Vuex.Store({
|
|
state: {
|
|
lightTheme: lightTheme,
|
|
darkTheme: lightTheme,
|
|
},
|
|
//实时监听state值的变化
|
|
getters: {
|
|
//页面调用this.$store.getters.filteredList => [7, 9, 20, 30]
|
|
filteredList: state => {
|
|
return state.list.filter(item => item > 5)
|
|
},
|
|
},
|
|
// 要调用mutations中的方法,必须通过commit的方式来提交
|
|
mutations: {
|
|
//页面调用this.$store.commit('changeTheme',1)
|
|
changeTheme(state,type){
|
|
state.theme = type
|
|
}
|
|
},
|
|
// action应该是mutation的前一步(异步操作出结果后再去调用mutation的方法)
|
|
actions: {
|
|
//页面调用this.$store.dispatch('getADDCounter',1)
|
|
getADDCounter(context,num){
|
|
context.commit('increment',num)
|
|
}
|
|
}
|
|
})
|
|
export default store
|