|
|
@@ -41,8 +41,10 @@ import VueMeta from 'vue-meta'
|
|
|
// 字典数据组件
|
|
|
import DictData from '@/components/DictData'
|
|
|
import webSite from '@/config/website'
|
|
|
+// import debounce from '@/components/directives/debounce';
|
|
|
|
|
|
Vue.prototype.website = webSite
|
|
|
+// Vue.prototype.debounce = debounce
|
|
|
|
|
|
// 全局方法挂载
|
|
|
Vue.prototype.getDicts = getDicts
|
|
|
@@ -88,6 +90,21 @@ DictData.install()
|
|
|
* please remove it before going online! ! !
|
|
|
*/
|
|
|
|
|
|
+//在main.js中
|
|
|
+// 提交以后禁用按钮一段时间,防止重复提交
|
|
|
+
|
|
|
+Vue.directive('noMoreClick', {
|
|
|
+ inserted(el, binding) {
|
|
|
+ el.addEventListener('click', e => {
|
|
|
+ el.classList.add('is-disabled')
|
|
|
+ el.disabled = true
|
|
|
+ setTimeout(() => {
|
|
|
+ el.disabled = false
|
|
|
+ el.classList.remove('is-disabled')
|
|
|
+ }, 1000)//我这里设置的是2000毫秒也就是2秒
|
|
|
+ })
|
|
|
+ }
|
|
|
+})
|
|
|
Vue.use(Element, {
|
|
|
size: Cookies.get('size') || 'medium' // set element-ui default size
|
|
|
})
|