|
@@ -10,9 +10,9 @@
|
|
export default {
|
|
export default {
|
|
props: {
|
|
props: {
|
|
// 成功之后的函数
|
|
// 成功之后的函数
|
|
- successFun: {
|
|
|
|
- type: Function
|
|
|
|
- },
|
|
|
|
|
|
+ // successFun: {
|
|
|
|
+ // type: Function
|
|
|
|
+ // },
|
|
//成功图标
|
|
//成功图标
|
|
successIcon: {
|
|
successIcon: {
|
|
type: String,
|
|
type: String,
|
|
@@ -34,9 +34,9 @@ export default {
|
|
default: "拖动滑块到最右边"
|
|
default: "拖动滑块到最右边"
|
|
},
|
|
},
|
|
//失败之后的函数
|
|
//失败之后的函数
|
|
- errorFun: {
|
|
|
|
- type: Function
|
|
|
|
- },
|
|
|
|
|
|
+ // errorFun: {
|
|
|
|
+ // type: Function
|
|
|
|
+ // },
|
|
//或者用值来进行监听
|
|
//或者用值来进行监听
|
|
status: {
|
|
status: {
|
|
type: String
|
|
type: String
|
|
@@ -75,21 +75,21 @@ export default {
|
|
document.onmouseup = ()=> {
|
|
document.onmouseup = ()=> {
|
|
|
|
|
|
if(this.disX !== MaxX){
|
|
if(this.disX !== MaxX){
|
|
- alert('fail')
|
|
|
|
ele.style.transition = '.5s all';
|
|
ele.style.transition = '.5s all';
|
|
ele.style.transform = 'translateX(0)';
|
|
ele.style.transform = 'translateX(0)';
|
|
this.rangeStatus = false;
|
|
this.rangeStatus = false;
|
|
//执行失败的函数
|
|
//执行失败的函数
|
|
-
|
|
|
|
- this.errorFun && this.errorFun();
|
|
|
|
|
|
+
|
|
|
|
+ this.$emit('errorFun')
|
|
|
|
+ // this.errorFun && this.errorFun();
|
|
}else{
|
|
}else{
|
|
- // alert('succc')
|
|
|
|
this.rangeStatus = true;
|
|
this.rangeStatus = true;
|
|
if(this.status){
|
|
if(this.status){
|
|
this.$parent[this.status] = true;
|
|
this.$parent[this.status] = true;
|
|
}
|
|
}
|
|
//执行成功的函数
|
|
//执行成功的函数
|
|
- this.successFun && this.successFun();
|
|
|
|
|
|
+ this.$emit('successFun')
|
|
|
|
+ // this.successFun && this.successFun();
|
|
}
|
|
}
|
|
document.onmousemove = null;
|
|
document.onmousemove = null;
|
|
document.onmouseup = null;
|
|
document.onmouseup = null;
|