12345678910111213141516171819202122232425 |
- export default{
- install(Vue){
- //这里是示例方法 getTime是方法名 function()可以携带参数
- Vue.prototype.getTime = function(val,fun,title){
- this.$confirm(val, '提示', {
- confirmButtonText: '确定',
- cancelButtonText: '取消',
- type: 'warning'
- }).then(() => {
- fun
- this.$message({
- type: 'success',
- message: title+'成功!'
- });
- }).catch(() => {
- this.$message({
- type: 'info',
- message: '已取消'+title
- });
- });
- }
- }
-
- }
|