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
20
src/components/cell/cell-group.vue
Normal file
20
src/components/cell/cell-group.vue
Normal file
|
@ -0,0 +1,20 @@
|
|||
<template>
|
||||
<div class="ivu-cell-group">
|
||||
<slot></slot>
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
export default {
|
||||
name: 'CellGroup',
|
||||
provide () {
|
||||
return {
|
||||
cellGroup: this
|
||||
};
|
||||
},
|
||||
methods: {
|
||||
handleClick (name) {
|
||||
this.$emit('on-click', name);
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
32
src/components/cell/cell-item.vue
Normal file
32
src/components/cell/cell-item.vue
Normal file
|
@ -0,0 +1,32 @@
|
|||
<template>
|
||||
<div class="ivu-cell-item">
|
||||
<div class="ivu-cell-icon">
|
||||
<slot name="icon"></slot>
|
||||
</div>
|
||||
<div class="ivu-cell-main">
|
||||
<div class="ivu-cell-title"><slot>{{ title }}</slot></div>
|
||||
<div class="ivu-cell-label"><slot name="label">{{ label }}</slot></div>
|
||||
</div>
|
||||
<div class="ivu-cell-footer">
|
||||
<span class="ivu-cell-extra"><slot name="extra">{{ extra }}</slot></span>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
export default {
|
||||
props: {
|
||||
title: {
|
||||
type: String,
|
||||
default: ''
|
||||
},
|
||||
label: {
|
||||
type: String,
|
||||
default: ''
|
||||
},
|
||||
extra: {
|
||||
type: String,
|
||||
default: ''
|
||||
},
|
||||
}
|
||||
};
|
||||
</script>
|
130
src/components/cell/cell.vue
Normal file
130
src/components/cell/cell.vue
Normal file
|
@ -0,0 +1,130 @@
|
|||
<template>
|
||||
<div :class="classes">
|
||||
<a
|
||||
v-if="to"
|
||||
:href="linkUrl"
|
||||
:target="target"
|
||||
class="ivu-cell-link"
|
||||
@click.exact="handleClickItem($event, false)"
|
||||
@click.ctrl="handleClickItem($event, true)"
|
||||
@click.meta="handleClickItem($event, true)">
|
||||
<CellItem :title="title" :label="label" :extra="extra">
|
||||
<slot name="icon" slot="icon"></slot>
|
||||
<slot slot="default"></slot>
|
||||
<slot name="extra" slot="extra"></slot>
|
||||
<slot name="label" slot="label"></slot>
|
||||
</CellItem>
|
||||
</a>
|
||||
<div class="ivu-cell-link" v-else @click="handleClickItem">
|
||||
<CellItem :title="title" :label="label" :extra="extra">
|
||||
<slot name="icon" slot="icon"></slot>
|
||||
<slot slot="default"></slot>
|
||||
<slot name="extra" slot="extra"></slot>
|
||||
<slot name="label" slot="label"></slot>
|
||||
</CellItem>
|
||||
</div>
|
||||
<div class="ivu-cell-arrow" v-if="to">
|
||||
<slot name="arrow">
|
||||
<Icon :type="arrowType" :custom="customArrowType" :size="arrowSize" />
|
||||
</slot>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
import CellItem from './cell-item.vue';
|
||||
import Icon from '../icon/icon.vue';
|
||||
import mixinsLink from '../../mixins/link';
|
||||
|
||||
const prefixCls = 'ivu-cell';
|
||||
|
||||
export default {
|
||||
name: 'Cell',
|
||||
inject: ['cellGroup'],
|
||||
mixins: [ mixinsLink ],
|
||||
components: { CellItem, Icon },
|
||||
props: {
|
||||
name: {
|
||||
type: [String, Number]
|
||||
},
|
||||
title: {
|
||||
type: String,
|
||||
default: ''
|
||||
},
|
||||
label: {
|
||||
type: String,
|
||||
default: ''
|
||||
},
|
||||
extra: {
|
||||
type: String,
|
||||
default: ''
|
||||
},
|
||||
disabled: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
},
|
||||
selected: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
}
|
||||
},
|
||||
data () {
|
||||
return {
|
||||
prefixCls: prefixCls
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
classes () {
|
||||
return [
|
||||
`${prefixCls}`,
|
||||
{
|
||||
[`${prefixCls}-disabled`]: this.disabled,
|
||||
[`${prefixCls}-selected`]: this.selected,
|
||||
[`${prefixCls}-with-link`]: this.to
|
||||
}
|
||||
];
|
||||
},
|
||||
// 3.4.0, global setting customArrow 有值时,arrow 赋值空
|
||||
arrowType () {
|
||||
let type = 'ios-arrow-forward';
|
||||
|
||||
if (this.$IVIEW) {
|
||||
if (this.$IVIEW.cell.customArrow) {
|
||||
type = '';
|
||||
} else if (this.$IVIEW.cell.arrow) {
|
||||
type = this.$IVIEW.cell.arrow;
|
||||
}
|
||||
}
|
||||
return type;
|
||||
},
|
||||
// 3.4.0, global setting
|
||||
customArrowType () {
|
||||
let type = '';
|
||||
|
||||
if (this.$IVIEW) {
|
||||
if (this.$IVIEW.cell.customArrow) {
|
||||
type = this.$IVIEW.cell.customArrow;
|
||||
}
|
||||
}
|
||||
return type;
|
||||
},
|
||||
// 3.4.0, global setting
|
||||
arrowSize () {
|
||||
let size = '';
|
||||
|
||||
if (this.$IVIEW) {
|
||||
if (this.$IVIEW.cell.arrowSize) {
|
||||
size = this.$IVIEW.cell.arrowSize;
|
||||
}
|
||||
}
|
||||
return size;
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
handleClickItem (event, new_window) {
|
||||
this.cellGroup.handleClick(this.name);
|
||||
|
||||
this.handleCheckClick(event, new_window);
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
5
src/components/cell/index.js
Normal file
5
src/components/cell/index.js
Normal file
|
@ -0,0 +1,5 @@
|
|||
import Cell from './cell.vue';
|
||||
import CellGroup from './cell-group.vue';
|
||||
|
||||
Cell.Group = CellGroup;
|
||||
export default Cell;
|
Loading…
Add table
Add a link
Reference in a new issue