remove href prop
This commit is contained in:
parent
e77474de9e
commit
924ce5e53e
1 changed files with 3 additions and 15 deletions
|
@ -1,6 +1,6 @@
|
||||||
<template>
|
<template>
|
||||||
<span>
|
<span>
|
||||||
<a v-if="to || href" :class="linkClasses" @click="handleClick">
|
<a v-if="to" :class="linkClasses" @click="handleClick">
|
||||||
<slot></slot>
|
<slot></slot>
|
||||||
</a>
|
</a>
|
||||||
<span v-else :class="linkClasses">
|
<span v-else :class="linkClasses">
|
||||||
|
@ -13,15 +13,13 @@
|
||||||
</span>
|
</span>
|
||||||
</template>
|
</template>
|
||||||
<script>
|
<script>
|
||||||
// todo 3.0 时废弃 href
|
import mixinsLink from '../../mixins/link';
|
||||||
const prefixCls = 'ivu-breadcrumb-item';
|
const prefixCls = 'ivu-breadcrumb-item';
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'BreadcrumbItem',
|
name: 'BreadcrumbItem',
|
||||||
|
mixins: [ mixinsLink ],
|
||||||
props: {
|
props: {
|
||||||
href: {
|
|
||||||
type: [Object, String]
|
|
||||||
},
|
|
||||||
to: {
|
to: {
|
||||||
type: [Object, String]
|
type: [Object, String]
|
||||||
},
|
},
|
||||||
|
@ -46,16 +44,6 @@
|
||||||
},
|
},
|
||||||
mounted () {
|
mounted () {
|
||||||
this.showSeparator = this.$slots.separator !== undefined;
|
this.showSeparator = this.$slots.separator !== undefined;
|
||||||
},
|
|
||||||
methods: {
|
|
||||||
handleClick () {
|
|
||||||
const isRoute = this.$router;
|
|
||||||
if (isRoute) {
|
|
||||||
this.replace ? this.$router.replace(this.to || this.href) : this.$router.push(this.to || this.href);
|
|
||||||
} else {
|
|
||||||
window.location.href = this.to || this.href;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
Loading…
Add table
Reference in a new issue