Support Breadcrumb

keep slot sepatator
This commit is contained in:
huixisheng 2017-03-03 21:05:30 +08:00
parent 2d74744daf
commit c06e99d09f
7 changed files with 59 additions and 12 deletions

View file

@ -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`;

View file

@ -18,7 +18,7 @@
return `${prefixCls}`;
}
},
compiled () {
mounted () {
this.updateChildren();
},
methods: {