tools.js 362 B

12345678910111213141516171819202122232425
  1. import { Message } from 'element-ui'
  2. let tools = {}
  3. tools.error=function(msg){
  4. Message({
  5. message: msg,
  6. type: 'error',
  7. duration: 2000
  8. })
  9. }
  10. tools.success=function(msg){
  11. Message({
  12. message: msg,
  13. type: 'success',
  14. duration: 2000
  15. })
  16. }
  17. tools.getLang=function(){
  18. return localStorage.getItem('lang') || 'en'
  19. }
  20. export default tools