Blame view

src/components/breadcrumb/breadcrumb-item.vue 1.28 KB
7fa943eb   梁灏   init
1
2
  <template>
      <span>
32a17436   梁灏   Breadcrumb update...
3
          <a v-if="to" :href="linkUrl" :class="linkClasses" @click.prevent="handleClick">
7fa943eb   梁灏   init
4
5
6
7
8
              <slot></slot>
          </a>
          <span v-else :class="linkClasses">
              <slot></slot>
          </span>
dcbfc232   梁灏   add name of Bread...
9
          <span :class="separatorClasses" v-html="separator" v-if="!showSeparator"></span>
c06e99d0   huixisheng   Support Breadcrumb
10
11
          <span :class="separatorClasses" v-else>
              <slot name="separator"></slot>
7fa943eb   梁灏   init
12
13
14
15
          </span>
      </span>
  </template>
  <script>
924ce5e5   梁灏   remove href prop
16
      import mixinsLink from '../../mixins/link';
7fa943eb   梁灏   init
17
18
19
      const prefixCls = 'ivu-breadcrumb-item';
  
      export default {
dcbfc232   梁灏   add name of Bread...
20
          name: 'BreadcrumbItem',
924ce5e5   梁灏   remove href prop
21
          mixins: [ mixinsLink ],
7fa943eb   梁灏   init
22
          props: {
05265bee   梁灏   fixed #2214
23
24
              to: {
                  type: [Object, String]
345c6863   梁灏   update Breadcrumb
25
26
27
28
              },
              replace: {
                  type: Boolean,
                  default: false
7fa943eb   梁灏   init
29
30
              }
          },
c06e99d0   huixisheng   Support Breadcrumb
31
32
33
34
          data () {
              return {
                  separator: '',
                  showSeparator: false
44412093   huixisheng   [fixed] eslint error
35
              };
c06e99d0   huixisheng   Support Breadcrumb
36
          },
7fa943eb   梁灏   init
37
38
39
40
41
42
43
          computed: {
              linkClasses () {
                  return `${prefixCls}-link`;
              },
              separatorClasses () {
                  return `${prefixCls}-separator`;
              }
345c6863   梁灏   update Breadcrumb
44
45
46
          },
          mounted () {
              this.showSeparator = this.$slots.separator !== undefined;
7fa943eb   梁灏   init
47
          }
b0893113   jingsam   :art: add eslint
48
49
      };
  </script>