update dist and lib

This commit is contained in:
JM
2019-12-06 21:07:16 +08:00
parent aeb021e5e4
commit 6876dec1ca
43 changed files with 7026 additions and 3592 deletions

View File

@ -2,21 +2,21 @@
<div class="dv-decoration-8" :ref="ref">
<svg :width="width" :height="height">
<polyline
stroke="#3f96a5"
:stroke="mergedColor[0]"
stroke-width="2"
fill="transparent"
:points="`${xPos(0)}, 0 ${xPos(30)}, ${height / 2}`"
/>
<polyline
stroke="#3f96a5"
:stroke="mergedColor[0]"
stroke-width="2"
fill="transparent"
:points="`${xPos(20)}, 0 ${xPos(50)}, ${height / 2} ${xPos(width)}, ${height / 2}`"
/>
<polyline
stroke="#3f96a5"
:stroke="mergedColor[1]"
fill="transparent"
stroke-width="3"
:points="`${xPos(0)}, ${height - 3}, ${xPos(200)}, ${height - 3}`"
@ -28,10 +28,18 @@
<script>
import autoResize from '../../../mixin/autoResize'
import { deepMerge } from '@jiaminghi/charts/lib/util/index'
import { deepClone } from '@jiaminghi/c-render/lib/plugin/util'
export default {
name: 'DvDecoration8',
mixins: [autoResize],
props: {
color: {
type: Array,
default: () => ([])
},
reverse: {
type: Boolean,
default: false
@ -39,7 +47,18 @@ export default {
},
data () {
return {
ref: 'decoration-8'
ref: 'decoration-8',
defaultColor: ['#3f96a5', '#3f96a5'],
mergedColor: []
}
},
watch: {
color () {
const { mergeColor } = this
mergeColor()
}
},
methods: {
@ -49,7 +68,17 @@ export default {
if (!reverse) return pos
return width - pos
},
mergeColor () {
const { color, defaultColor } = this
this.mergedColor = deepMerge(deepClone(defaultColor, true), color || [])
}
},
mounted () {
const { mergeColor } = this
mergeColor()
}
}
</script>