fa.style.mixin.js 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. module.exports = {
  2. computed: {
  3. theme() {
  4. let style = {};
  5. if (this.vuex_theme.value) {
  6. let theme = this.vuex_theme.value;
  7. let ladder = theme.ladder || 10;
  8. let number = theme.number || 9;
  9. let border = theme.border || 5;
  10. let colorArr = this.$u.colorGradient(theme.bgColor, theme.color, ladder);
  11. style = Object.assign({
  12. lightColor:colorArr[number] || '#f5f5f5',
  13. faBorderColor:colorArr[border] || '#f5f5f5'
  14. },theme);
  15. }else{
  16. style = {
  17. bgColor: "#0301c5",
  18. color: "#ffffff",
  19. lightColor:'#f5f5f5',
  20. faBorderColor:'#f5f5f5'
  21. };
  22. }
  23. return style;
  24. },
  25. btnBgColor(param, type) {
  26. return (param, type) => {
  27. if(typeof type == 'undefined'){
  28. return param ? this.theme.bgColor : this.theme.lightColor;
  29. }
  30. return param == type ? this.theme.bgColor : this.theme.lightColor;
  31. };
  32. },
  33. btnColor(param, type) {
  34. return (param, type) => {
  35. if(typeof type == 'undefined'){
  36. return param? this.theme.color : this.theme.bgColor;
  37. }
  38. return param == type ? this.theme.color : this.theme.bgColor;
  39. };
  40. }
  41. },
  42. }