Skip to content

Commit

Permalink
add exclude props
Browse files Browse the repository at this point in the history
  • Loading branch information
SUNbrightness committed Jun 18, 2020
1 parent 8f0758a commit ebf97eb
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 4 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ Attribute|type| default |explain
---|---|---|---
transitionTime|number|500|过渡时间
transitionRange|string|100%|过渡幅度

exclude|Array|[]|不需要动画的路由

## show
![show](https://sunbrightness.github.io/my-img/1591771235893.gif)
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "vue-router-page-turning",
"version": "1.1.4",
"version": "1.2.4",
"description": "As the title suggests",
"main": "./src/VueRouterPageTurning.vue",
"scripts": {
Expand Down
18 changes: 16 additions & 2 deletions src/VueRouterPageTurning.vue
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,12 @@
}
},
props: {
exclude: {
type: Array,
default: function () {
return ['/']
},
},
transitionTime: {
type: Number,
default: 500
Expand Down Expand Up @@ -74,8 +80,16 @@
return;
}
}
//非返回
this.transitionName = 'vue-router-page-truning-left';
//判断是否是排除路由
if (_.indexOf(this.exclude, toPath) != -1){
console.log("no");
this.transitionName = '';
}else{
//非返回
this.transitionName = 'vue-router-page-truning-left';
}
//浏览记录入栈
this.historyQueue.push(toPath);
}
Expand Down

0 comments on commit ebf97eb

Please sign in to comment.