[new feature] Tab support vue-router (#305)

* fix: Tabbar icon line-height

* [new feature] progress add showPivot prop

* [new feature] TabItem support vue-router
This commit is contained in:
neverland
2017-11-10 09:56:46 -06:00
committed by GitHub
parent 5048d4fbac
commit c7031fb291
5 changed files with 36 additions and 10 deletions

View File

@@ -30,36 +30,30 @@
<script>
import Icon from '../icon';
import RouterLink from '../mixins/router-link';
export default {
name: 'van-cell',
mixins: [RouterLink],
components: {
[Icon.name]: Icon
},
props: {
url: String,
icon: String,
title: String,
label: String,
isLink: Boolean,
replace: Boolean,
required: Boolean,
to: [String, Object],
value: [String, Number]
},
methods: {
onClick() {
this.$emit('click');
const { to, url, $router, replace } = this;
if (to && $router) {
$router[replace ? 'replace' : 'push'](to);
} else if (url) {
replace ? location.replace(url) : location.href = url;
}
this.routerLink();
}
}
};