Blame view

src/components/breadcrumb/breadcrumb-item.vue 1.13 KB
7fa943eb   梁灏   init
1
2
  <template>
      <span>
3cf11946   梁灏   Breadcrumb add ta...
3
          <a v-if="to" :href="linkUrl" :target="target" :class="linkClasses" @click="handleCheckClick">
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
      const prefixCls = 'ivu-breadcrumb-item';
7fa943eb   梁灏   init
18
19
  
      export default {
dcbfc232   梁灏   add name of Bread...
20
          name: 'BreadcrumbItem',
924ce5e5   梁灏   remove href prop
21
          mixins: [ mixinsLink ],
7fa943eb   梁灏   init
22
          props: {
9932b935   梁灏   update
23
  
7fa943eb   梁灏   init
24
          },
c06e99d0   huixisheng   Support Breadcrumb
25
26
27
28
          data () {
              return {
                  separator: '',
                  showSeparator: false
44412093   huixisheng   [fixed] eslint error
29
              };
c06e99d0   huixisheng   Support Breadcrumb
30
          },
7fa943eb   梁灏   init
31
32
33
34
35
36
37
          computed: {
              linkClasses () {
                  return `${prefixCls}-link`;
              },
              separatorClasses () {
                  return `${prefixCls}-separator`;
              }
345c6863   梁灏   update Breadcrumb
38
39
40
          },
          mounted () {
              this.showSeparator = this.$slots.separator !== undefined;
7fa943eb   梁灏   init
41
          }
b0893113   jingsam   :art: add eslint
42
43
      };
  </script>