init
This commit is contained in:
梁灏 2016-09-09 14:29:19 +08:00
parent 5762337416
commit 7fa943eb39
128 changed files with 51042 additions and 1 deletions

View file

@ -0,0 +1,36 @@
<template>
<span>
<a v-if="href" :href="href" :class="linkClasses">
<slot></slot>
</a>
<span v-else :class="linkClasses">
<slot></slot>
</span>
<span :class="separatorClasses">
<slot name="separator">{{{ separator }}}</slot>
</span>
</span>
</template>
<script>
const prefixCls = 'ivu-breadcrumb-item';
export default {
props: {
href: {
type: String
},
separator: {
type: String,
default: '/'
}
},
computed: {
linkClasses () {
return `${prefixCls}-link`;
},
separatorClasses () {
return `${prefixCls}-separator`;
}
}
}
</script>

View file

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

View file

@ -0,0 +1,5 @@
import Breadcrumb from './breadcrumb.vue';
import BreadcrumbItem from './breadcrumb-item.vue';
Breadcrumb.Item = BreadcrumbItem;
export default Breadcrumb;