Support Breadcrumb
keep slot sepatator
This commit is contained in:
parent
2d74744daf
commit
c06e99d09f
7 changed files with 59 additions and 12 deletions
|
@ -6,8 +6,10 @@
|
|||
<span v-else :class="linkClasses">
|
||||
<slot></slot>
|
||||
</span>
|
||||
<span :class="separatorClasses">
|
||||
<slot name="separator">{{{ separator }}}</slot>
|
||||
<span :class="separatorClasses" v-html="separator" v-if="!showSeparator">
|
||||
</span>
|
||||
<span :class="separatorClasses" v-else>
|
||||
<slot name="separator"></slot>
|
||||
</span>
|
||||
</span>
|
||||
</template>
|
||||
|
@ -18,12 +20,17 @@
|
|||
props: {
|
||||
href: {
|
||||
type: String
|
||||
},
|
||||
separator: {
|
||||
type: String,
|
||||
default: '/'
|
||||
}
|
||||
},
|
||||
data () {
|
||||
return {
|
||||
separator: '',
|
||||
showSeparator: false
|
||||
}
|
||||
},
|
||||
mounted () {
|
||||
this.showSeparator = this.$slots.separator !== undefined;
|
||||
},
|
||||
computed: {
|
||||
linkClasses () {
|
||||
return `${prefixCls}-link`;
|
||||
|
|
|
@ -18,7 +18,7 @@
|
|||
return `${prefixCls}`;
|
||||
}
|
||||
},
|
||||
compiled () {
|
||||
mounted () {
|
||||
this.updateChildren();
|
||||
},
|
||||
methods: {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue