Commit 924ce5e53e424b410d43941851a75d70dadd20ff

Authored by 梁灏
1 parent e77474de

remove href prop

Showing 1 changed file with 3 additions and 15 deletions   Show diff stats
src/components/breadcrumb/breadcrumb-item.vue
1 1 <template>
2 2 <span>
3   - <a v-if="to || href" :class="linkClasses" @click="handleClick">
  3 + <a v-if="to" :class="linkClasses" @click="handleClick">
4 4 <slot></slot>
5 5 </a>
6 6 <span v-else :class="linkClasses">
... ... @@ -13,15 +13,13 @@
13 13 </span>
14 14 </template>
15 15 <script>
16   - // todo 3.0 时废弃 href
  16 + import mixinsLink from '../../mixins/link';
17 17 const prefixCls = 'ivu-breadcrumb-item';
18 18  
19 19 export default {
20 20 name: 'BreadcrumbItem',
  21 + mixins: [ mixinsLink ],
21 22 props: {
22   - href: {
23   - type: [Object, String]
24   - },
25 23 to: {
26 24 type: [Object, String]
27 25 },
... ... @@ -46,16 +44,6 @@
46 44 },
47 45 mounted () {
48 46 this.showSeparator = this.$slots.separator !== undefined;
49   - },
50   - methods: {
51   - handleClick () {
52   - const isRoute = this.$router;
53   - if (isRoute) {
54   - this.replace ? this.$router.replace(this.to || this.href) : this.$router.push(this.to || this.href);
55   - } else {
56   - window.location.href = this.to || this.href;
57   - }
58   - }
59 47 }
60 48 };
61 49 </script>
... ...