2016-09-09 14:29:19 +08:00
|
|
|
<template>
|
|
|
|
<div :class="classes">
|
|
|
|
<slot></slot>
|
|
|
|
</div>
|
|
|
|
</template>
|
|
|
|
<script>
|
|
|
|
const prefixCls = 'ivu-breadcrumb';
|
|
|
|
|
|
|
|
export default {
|
2017-03-05 22:02:46 +08:00
|
|
|
name: 'Breadcrumb',
|
2016-09-09 14:29:19 +08:00
|
|
|
props: {
|
|
|
|
separator: {
|
|
|
|
type: String,
|
|
|
|
default: '/'
|
|
|
|
}
|
|
|
|
},
|
|
|
|
computed: {
|
|
|
|
classes () {
|
|
|
|
return `${prefixCls}`;
|
|
|
|
}
|
|
|
|
},
|
2017-03-03 21:05:30 +08:00
|
|
|
mounted () {
|
2016-09-09 14:29:19 +08:00
|
|
|
this.updateChildren();
|
|
|
|
},
|
2017-04-18 13:48:18 +08:00
|
|
|
updated () {
|
2017-04-18 14:06:25 +08:00
|
|
|
this.updateChildren();
|
2017-04-18 13:48:18 +08:00
|
|
|
},
|
2016-09-09 14:29:19 +08:00
|
|
|
methods: {
|
|
|
|
updateChildren () {
|
|
|
|
this.$children.forEach((child) => {
|
|
|
|
child.separator = this.separator;
|
|
|
|
});
|
|
|
|
}
|
|
|
|
},
|
|
|
|
watch: {
|
|
|
|
separator () {
|
|
|
|
this.updateChildren();
|
|
|
|
}
|
|
|
|
}
|
2016-12-25 22:49:42 +08:00
|
|
|
};
|
|
|
|
</script>
|