Blame view

src/components/breadcrumb/breadcrumb-item.vue 1.06 KB
7fa943eb   梁灏   init
1
2
3
4
5
6
7
8
  <template>
      <span>
          <a v-if="href" :href="href" :class="linkClasses">
              <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
16
17
18
          </span>
      </span>
  </template>
  <script>
      const prefixCls = 'ivu-breadcrumb-item';
  
      export default {
dcbfc232   梁灏   add name of Bread...
19
          name: 'BreadcrumbItem',
7fa943eb   梁灏   init
20
21
22
          props: {
              href: {
                  type: String
7fa943eb   梁灏   init
23
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
31
32
33
          },
          mounted () {
              this.showSeparator = this.$slots.separator !== undefined;
          },
7fa943eb   梁灏   init
34
35
36
37
38
39
40
41
          computed: {
              linkClasses () {
                  return `${prefixCls}-link`;
              },
              separatorClasses () {
                  return `${prefixCls}-separator`;
              }
          }
b0893113   jingsam   :art: add eslint
42
43
      };
  </script>