optimize Timeline style

optimize Timeline style
This commit is contained in:
梁灏 2016-11-16 15:26:51 +08:00
parent 05b5dd7b8d
commit c9433dcce5
2 changed files with 56 additions and 57 deletions

View file

@ -14,9 +14,9 @@
&-tail { &-tail {
height: 100%; height: 100%;
border-left: 2px solid @timeline-color; border-left: 1px solid @timeline-color;
position: absolute; position: absolute;
left: 5px; left: 6px;
top: 0; top: 0;
} }
@ -25,11 +25,11 @@
} }
&-head { &-head {
width: 12px; width: 13px;
height: 12px; height: 13px;
background-color: #fff; background-color: #fff;
border-radius: 100px; border-radius: 50%;
border: 2px solid transparent; border: 1px solid transparent;
position: absolute; position: absolute;
&-blue { &-blue {
@ -57,7 +57,7 @@
border-radius: 0; border-radius: 0;
font-size: @font-size-base; font-size: @font-size-base;
position: absolute; position: absolute;
left: -14px; left: -13px;
.transform(translateY(-50%)); .transform(translateY(-50%));
} }
@ -78,7 +78,7 @@
&&-pending &-item:nth-last-of-type(2) { &&-pending &-item:nth-last-of-type(2) {
.@{timeline-prefix-cls}-item-tail { .@{timeline-prefix-cls}-item-tail {
border-left: 2px dotted @timeline-color; border-left: 1px dotted @timeline-color;
} }
.@{timeline-prefix-cls}-item-content { .@{timeline-prefix-cls}-item-content {
min-height: 48px; min-height: 48px;

View file

@ -1,63 +1,62 @@
<template> <template>
<div style="margin: 50px;width:300px"> <div style="width: 150px;margin:100px">
{{ value | json }} <Cascader :data="data" :value.sync="value1"></Cascader>
<Cascader size="large" :data="data" @on-change="change" trigger="hover" :render-format="format"></Cascader>
</div> </div>
</template> </template>
<script> <script>
import { Cascader } from 'iview';
export default { export default {
props: {
},
data () { data () {
return { return {
value: ['jiangsu', 'hhh', 'ddd'], value1: [],
// value: [],
data: [{ data: [{
value: 'zhejiang', value: 'beijing',
label: 'Zhejiang', label: '北京',
children: [{ children: [
value: 'hangzhou', {
label: 'Hangzhou' value: 'gugong',
}], label: '故宫'
},
{
value: 'tiantan',
label: '天坛'
},
{
value: 'wangfujing',
label: '王府井'
}
]
}, { }, {
value: 'jiangsu', value: 'jiangsu',
label: 'Jiangsu', label: '江苏',
children: [{ children: [
value: 'nanjing', {
label: 'Nanjing', value: 'nanjing',
// disabled: true, label: '南京',
children: [{ children: [
value: 'zhonghuamen', {
label: 'Zhong Hua Men', value: 'fuzimiao',
children: [{ label: '夫子庙',
value: 'abc', }
label: 'ABC' ]
}] },
}] {
}, { value: 'suzhou',
value: 'hhh', label: '苏州',
label: 'HHH', children: [
children: [{ {
value: 'ddd', value: 'zhuozhengyuan',
label: 'DDD' label: '拙政园',
}] },
}] {
value: 'shizilin',
label: '狮子林',
}
]
}
],
}] }]
} }
},
computed: {
},
methods: {
change (data, opts) {
console.log(data);
console.log(opts)
},
format (label, data) {
return label[label.length - 1];
}
} }
} }
</script> </script>