update the master branch to the latest
This commit is contained in:
parent
67d534df27
commit
23a0ba9831
611 changed files with 122648 additions and 0 deletions
50
src/components/breadcrumb/breadcrumb-item.vue
Normal file
50
src/components/breadcrumb/breadcrumb-item.vue
Normal file
|
@ -0,0 +1,50 @@
|
|||
<template>
|
||||
<span>
|
||||
<a
|
||||
v-if="to"
|
||||
:href="linkUrl"
|
||||
:target="target"
|
||||
:class="linkClasses"
|
||||
@click.exact="handleCheckClick($event, false)"
|
||||
@click.ctrl="handleCheckClick($event, true)"
|
||||
@click.meta="handleCheckClick($event, true)">
|
||||
<slot></slot>
|
||||
</a>
|
||||
<span v-else :class="linkClasses">
|
||||
<slot></slot>
|
||||
</span>
|
||||
<span :class="separatorClasses" v-html="separator" v-if="!showSeparator"></span>
|
||||
<span :class="separatorClasses" v-else>
|
||||
<slot name="separator"></slot>
|
||||
</span>
|
||||
</span>
|
||||
</template>
|
||||
<script>
|
||||
import mixinsLink from '../../mixins/link';
|
||||
const prefixCls = 'ivu-breadcrumb-item';
|
||||
|
||||
export default {
|
||||
name: 'BreadcrumbItem',
|
||||
mixins: [ mixinsLink ],
|
||||
props: {
|
||||
|
||||
},
|
||||
data () {
|
||||
return {
|
||||
separator: '',
|
||||
showSeparator: false
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
linkClasses () {
|
||||
return `${prefixCls}-link`;
|
||||
},
|
||||
separatorClasses () {
|
||||
return `${prefixCls}-separator`;
|
||||
}
|
||||
},
|
||||
mounted () {
|
||||
this.showSeparator = this.$slots.separator !== undefined;
|
||||
}
|
||||
};
|
||||
</script>
|
43
src/components/breadcrumb/breadcrumb.vue
Normal file
43
src/components/breadcrumb/breadcrumb.vue
Normal file
|
@ -0,0 +1,43 @@
|
|||
<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>
|
5
src/components/breadcrumb/index.js
Normal file
5
src/components/breadcrumb/index.js
Normal file
|
@ -0,0 +1,5 @@
|
|||
import Breadcrumb from './breadcrumb.vue';
|
||||
import BreadcrumbItem from './breadcrumb-item.vue';
|
||||
|
||||
Breadcrumb.Item = BreadcrumbItem;
|
||||
export default Breadcrumb;
|
Loading…
Add table
Add a link
Reference in a new issue