forked from MeCKodo/vue-tap
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
kodo
committed
Mar 16, 2017
1 parent
020013b
commit 17111b8
Showing
2 changed files
with
54 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
<head> | ||
<meta charset="UTF-8"> | ||
<meta name="format-detection" content="telephone=no"/> | ||
<meta name="screen-orientation" content="portrait"> | ||
<meta name="viewport" | ||
content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no"/> | ||
<title>方圆书院</title> | ||
</head> | ||
<body> | ||
<div id="container"> | ||
<h1> | ||
// 修复v-if v-else重复事件绑定的问题 | ||
</h1> | ||
<div class="right" v-tap="{ methods : sendOrder }" v-if="canBuy"> 确认订购if </div> | ||
<div v-else class="right disable">确认订购else</div> | ||
</div> | ||
<script src="./vue2.0.js"></script> | ||
<script src="./vue-tap.js"></script> | ||
<script> | ||
new Vue({ | ||
el : "#container", | ||
data : { | ||
canBuy : true, | ||
}, | ||
mounted:function () { | ||
// 修复v-if v-else的问题 | ||
setTimeout(() => { | ||
this.canBuy = false; | ||
setTimeout(() => { | ||
this.canBuy = true; | ||
},2000); | ||
},2000); | ||
|
||
}, | ||
methods : { | ||
sendOrder : function () { | ||
if(this.canBuy) { | ||
console.log('if') | ||
} else { | ||
console.log('else'); | ||
} | ||
} | ||
} | ||
}) | ||
</script> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters