Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
campSite
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
杨梦雪
campSite
Commits
02aecb3d
Commit
02aecb3d
authored
Feb 14, 2022
by
杨梦雪
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
防止重复点击指令
parent
ed6401bd
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
23 additions
and
1 deletion
+23
-1
src/main.js
src/main.js
+4
-0
src/utils/preventRepeatClick.js
src/utils/preventRepeatClick.js
+16
-0
src/views/index/camp/homework/refer.vue
src/views/index/camp/homework/refer.vue
+3
-1
No files found.
src/main.js
View file @
02aecb3d
...
@@ -17,6 +17,10 @@ Vue.use(ElementUI)
...
@@ -17,6 +17,10 @@ Vue.use(ElementUI)
Vue
.
prototype
.
download
=
download
Vue
.
prototype
.
download
=
download
Vue
.
prototype
.
upload
=
upload
Vue
.
prototype
.
upload
=
upload
// 防止重复点击自定义属性
import
preventReClick
from
'
./utils/preventRepeatClick.js
'
Vue
.
use
(
preventReClick
);
Vue
.
prototype
.
$errorScroll
=
function
errorScroll
(
callback
)
{
Vue
.
prototype
.
$errorScroll
=
function
errorScroll
(
callback
)
{
this
.
$nextTick
(()
=>
{
this
.
$nextTick
(()
=>
{
// this.loading = false;
// this.loading = false;
...
...
src/utils/preventRepeatClick.js
0 → 100644
View file @
02aecb3d
export
default
{
install
(
Vue
)
{
Vue
.
directive
(
'
preventReClick
'
,
{
inserted
(
el
,
binding
)
{
el
.
addEventListener
(
'
click
'
,
()
=>
{
if
(
!
el
.
disabled
)
{
el
.
disabled
=
true
;
setTimeout
(()
=>
{
el
.
disabled
=
false
;
},
binding
.
value
||
1000
);
}
})
}
})
}
}
\ No newline at end of file
src/views/index/camp/homework/refer.vue
View file @
02aecb3d
...
@@ -246,7 +246,9 @@
...
@@ -246,7 +246,9 @@
</div>
</div>
<el-form-item
class=
"btn"
v-if=
"student_status == 0"
>
<el-form-item
class=
"btn"
v-if=
"student_status == 0"
>
<el-button
type=
"primary"
@
click=
"confirm"
>
提交
</el-button>
<el-button
type=
"primary"
v-preventReClick=
"1000"
@
click=
"confirm"
>
提交
</el-button
>
</el-form-item>
</el-form-item>
</el-form>
</el-form>
</div>
</div>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment