//import request from '@/utils/request.js' // 防止处理多次点击 function noMultipleClicks(methods, info) { // methods是点击后需要执行的函数, info是函数需要传的参数 let that = this; if (that.noClick) { // 第一次点击 that.noClick= false; if((info && info !== '') || info ==0) { // info是执行函数需要传的参数 methods(info); } else { methods(); } setTimeout(()=> { that.noClick= true; }, 3000) } else { // 这里是重复点击的判断 } } const getHashQuery = function(query) { //console.log(location.hash) if (location.hash.indexOf(query) > -1) { const cur = location.hash.slice(location.hash.indexOf(query) + query.length + 1, location.hash.length) if (cur.indexOf('&') > -1) { return cur.slice(0, cur.indexOf('&')) } else { return cur } } else { return false } } export default { commonData:{ companyType:1, }, noMultipleClicks, // 禁止多次点击 getHashQuery, }