button.js 485 B

12345678910111213141516171819202122232425
  1. /**
  2. * 按钮统一处理
  3. * <pre>
  4. * 作者:hugh zhuang
  5. * 邮箱:3378340995@qq.com
  6. * 日期:2018-10-08-下午3:29:34
  7. * 版权:广州流辰信息技术有限公司
  8. * </pre>
  9. */
  10. import BUTTONS from '@/constants/buttons'
  11. /**
  12. * 获取按钮的icon
  13. * @param {*} key
  14. */
  15. export function getButtonIcon(key) {
  16. return BUTTONS[key] ? BUTTONS[key].icon : null
  17. }
  18. /**
  19. * 获取按钮类型
  20. */
  21. export function getButtonType(key) {
  22. return BUTTONS[key] ? BUTTONS[key].type : 'primary'
  23. }