DemuMesDataV/lib/components/decoration7/src/main.vue

75 lines
1.4 KiB
Vue
Raw Normal View History

2019-08-22 14:41:07 +08:00
<template>
<div class="dv-decoration-7">
<svg width="21px" height="20px">
<polyline
stroke-width="4"
fill="transparent"
2019-12-06 21:07:16 +08:00
:stroke="mergedColor[0]"
2019-08-22 14:41:07 +08:00
points="10, 0 19, 10 10, 20"
/>
<polyline
stroke-width="2"
fill="transparent"
2019-12-06 21:07:16 +08:00
:stroke="mergedColor[1]"
2019-08-22 14:41:07 +08:00
points="2, 0 11, 10 2, 20"
/>
</svg>
<slot></slot>
<svg width="21px" height="20px">
<polyline
stroke-width="4"
fill="transparent"
2019-12-06 21:07:16 +08:00
:stroke="mergedColor[0]"
2019-08-22 14:41:07 +08:00
points="11, 0 2, 10 11, 20"
/>
<polyline
stroke-width="2"
fill="transparent"
2019-12-06 21:07:16 +08:00
:stroke="mergedColor[1]"
2019-08-22 14:41:07 +08:00
points="19, 0 10, 10 19, 20"
/>
</svg>
</div>
</template>
<script>
2019-12-06 21:07:16 +08:00
import { deepMerge } from '@jiaminghi/charts/lib/util/index'
import { deepClone } from '@jiaminghi/c-render/lib/plugin/util'
2019-08-22 14:41:07 +08:00
export default {
2019-12-06 21:07:16 +08:00
name: 'DvDecoration7',
props: {
color: {
type: Array,
default: () => ([])
}
},
data () {
return {
defaultColor: ['#1dc1f5', '#1dc1f5'],
mergedColor: []
}
},
watch: {
color () {
const { mergeColor } = this
mergeColor()
}
},
methods: {
mergeColor () {
const { color, defaultColor } = this
this.mergedColor = deepMerge(deepClone(defaultColor, true), color || [])
}
},
mounted () {
const { mergeColor } = this
mergeColor()
}
2019-08-22 14:41:07 +08:00
}
</script>