theme.js 696 B

1234567891011121314151617181920212223242526272829303132
  1. const theme = {
  2. getTheme(){
  3. return {
  4. color:uni.$tm.vx.state().tmVuetify.color,
  5. black:uni.$tm.vx.state().tmVuetify.black
  6. }
  7. },
  8. setBlack(arg){
  9. let p = arg;
  10. if(typeof arg !=='undefined'){
  11. uni.$tm.vx.commit("setTmVuetifyBlack",arg)
  12. }else{
  13. p = !uni.$tm.vx.state().tmVuetify.black;
  14. uni.$tm.vx.commit("setTmVuetifyBlack",!uni.$tm.vx.state().tmVuetify.black)
  15. }
  16. uni.setStorageSync('setTmVuetifyBlack',p)
  17. },
  18. setTheme(arg){
  19. let p = arg||"primary";
  20. uni.$tm.vx.commit("setTmVuetifyColor",p)
  21. uni.setStorageSync('setTmVuetifyColor',p)
  22. },
  23. clear(){
  24. uni.$tm.vx.commit("setTmVuetifyColor",'')
  25. uni.removeStorageSync('setTmVuetifyColor')
  26. }
  27. }
  28. export default theme;