iview/src/components/breadcrumb/breadcrumb.vue
梁灏 6d89ed9619 #713
@Becavalier
2017-04-20 09:46:11 +08:00

43 lines
932 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();
},
updated () {
this.$nextTick(() => {
this.updateChildren();
});
},
methods: {
updateChildren () {
this.$children.forEach((child) => {
child.separator = this.separator;
});
}
},
watch: {
separator () {
this.updateChildren();
}
}
};
</script>