Skip to content

Commit

Permalink
修复PC点击bug,新增测试
Browse files Browse the repository at this point in the history
  • Loading branch information
kodo committed Sep 25, 2016
1 parent 7779868 commit 47ab98c
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 2 deletions.
7 changes: 7 additions & 0 deletions README.MD
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,13 @@ args : function(index,el,e) {
}
```

### 2016.9.25(update)

> * 修复了PC端的bug
> * test-href.html页面,新增测试
> * <a v-tap="a++">我是测试v-tap="a++"直接执行表达式</a>
<a href="javascript:widnow.history.go(-1);" v-tap>我是history.go(-1)</a>
### 2016.9.19(update)

> * 优化了a标签快速跳转逻辑,可以直接在 <a href="xxx" v-tap></a> 写v-tap指令,这样即可快速跳转
Expand Down
1 change: 1 addition & 0 deletions demo.html
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@
</p>

<a href="www.baidu.com" v-tap.prevent="callback">I'm a tag</a>
<a href="test-href.html" v-tap>aaaaaaaaaa</a>
<script src="//cdn.bootcss.com/jquery/2.1.4/jquery.js"></script>
<script src="vue.js"></script>
<script src="vue-tap.js"></script>
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "v-tap",
"version": "1.0.4",
"version": "1.0.5",
"description": "a directive of vue.js",
"main": "vue-tap.js",
"repository": {
Expand Down
5 changes: 5 additions & 0 deletions test-href.html
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@
<a v-tap.prevent="cant" href="这是无法跳转的">这是无法跳转的</a>
<!--这样一样会直接快速跳转不会执行cant 除非设置了prevent-->
<a href="aaa" v-tap="cant">can't</a>
<a v-tap="a++">我是测试v-tap="a++"直接执行表达式</a>
<a href="javascript:widnow.history.go(-1);" v-tap>我是history.go(-1)</a>
<p>item12</p>
<p>item13</p>
<p>item14</p>
Expand All @@ -46,6 +48,9 @@
<script>
var V = new Vue({
el: "body",
data : {
a: 1,
},
methods: {
cli: function (e) {

Expand Down
2 changes: 1 addition & 1 deletion vue-tap.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
if(self.isPC()) {
self.el.addEventListener('click',function(e) {
e.preventDefault();
fn.call(self,e);
self.handler.call(self,e);
},false);
} else {
this.el.addEventListener('touchstart',function(e) {
Expand Down

0 comments on commit 47ab98c

Please sign in to comment.