iview/src/components/breadcrumb/breadcrumb.vue
梁灏 dcbfc23239 add name of Breadcrumb
add name of Breadcrumb
2017-03-05 22:02:46 +08:00

38 lines
810 B
Vue

<template>
<div :class="classes">
<slot></slot>
</div>
</template>
<script>
const prefixCls = 'ivu-breadcrumb';
export default {
name: 'Breadcrumb',
props: {
separator: {
type: String,
default: '/'
}
},
computed: {
classes () {
return `${prefixCls}`;
}
},
mounted () {
this.updateChildren();
},
methods: {
updateChildren () {
this.$children.forEach((child) => {
child.separator = this.separator;
});
}
},
watch: {
separator () {
this.updateChildren();
}
}
};
</script>