common.js 1019 B

1234567891011121314151617181920212223242526272829303132333435
  1. export default{
  2. data(){
  3. },
  4. methods: {
  5. randomString(encode = 36, number = -8) {
  6. return Math.random() // 生成随机数字,
  7. .toString(encode) // 转化成36进制
  8. .slice(number)
  9. }
  10. }
  11. // install(Vue){
  12. // //这里是示例方法 getTime是方法名 function()可以携带参数
  13. // Vue.prototype.getTime = function(val,fun,title){
  14. // this.$confirm(val, '提示', {
  15. // confirmButtonText: '确定',
  16. // cancelButtonText: '取消',
  17. // type: 'warning'
  18. // }).then(() => {
  19. // fun
  20. // this.$message({
  21. // type: 'success',
  22. // message: title+'成功!'
  23. // });
  24. // }).catch(() => {
  25. // this.$message({
  26. // type: 'info',
  27. // message: '已取消'+title
  28. // });
  29. // });
  30. // }
  31. // }
  32. }