Blame view

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