update dist and lib
This commit is contained in:
@ -14,15 +14,6 @@
|
||||
fill: none;
|
||||
stroke-width: 1;
|
||||
}
|
||||
.dv-border-box-2 .dv-border-svg-container circle {
|
||||
fill: #fff;
|
||||
}
|
||||
.dv-border-box-2 .dv-bb2-line1 {
|
||||
stroke: #fff;
|
||||
}
|
||||
.dv-border-box-2 .dv-bb2-line2 {
|
||||
stroke: rgba(255, 255, 255, 0.6);
|
||||
}
|
||||
.dv-border-box-2 .border-box-content {
|
||||
position: relative;
|
||||
width: 100%;
|
||||
|
@ -1,14 +1,18 @@
|
||||
<template>
|
||||
<div class="dv-border-box-2" :ref="ref">
|
||||
<svg class="dv-border-svg-container" :width="width" :height="height">
|
||||
<polyline class="dv-bb2-line1"
|
||||
:points="`2, 2 ${width - 2} ,2 ${width - 2}, ${height - 2} 2, ${height - 2} 2, 2`" />
|
||||
<polyline class="dv-bb2-line2"
|
||||
:points="`6, 6 ${width - 6}, 6 ${width - 6}, ${height - 6} 6, ${height - 6} 6, 6`" />
|
||||
<circle cx="11" cy="11" r="1" />
|
||||
<circle :cx="width - 11" cy="11" r="1" />
|
||||
<circle :cx="width - 11" :cy="height - 11" r="1" />
|
||||
<circle cx="11" :cy="height - 11" r="1" />
|
||||
<polyline
|
||||
:stroke="mergedColor[0]"
|
||||
:points="`2, 2 ${width - 2} ,2 ${width - 2}, ${height - 2} 2, ${height - 2} 2, 2`"
|
||||
/>
|
||||
<polyline
|
||||
:stroke="mergedColor[1]"
|
||||
:points="`6, 6 ${width - 6}, 6 ${width - 6}, ${height - 6} 6, ${height - 6} 6, 6`"
|
||||
/>
|
||||
<circle :fill="mergedColor[0]" cx="11" cy="11" r="1" />
|
||||
<circle :fill="mergedColor[0]" :cx="width - 11" cy="11" r="1" />
|
||||
<circle :fill="mergedColor[0]" :cx="width - 11" :cy="height - 11" r="1" />
|
||||
<circle :fill="mergedColor[0]" cx="11" :cy="height - 11" r="1" />
|
||||
</svg>
|
||||
|
||||
<div class="border-box-content">
|
||||
@ -20,13 +24,46 @@
|
||||
<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: 'DvBorderBox2',
|
||||
mixins: [autoResize],
|
||||
props: {
|
||||
color: {
|
||||
type: Array,
|
||||
default: () => ([])
|
||||
}
|
||||
},
|
||||
data () {
|
||||
return {
|
||||
ref: 'border-box-2'
|
||||
ref: 'border-box-2',
|
||||
|
||||
defaultColor: ['#fff', 'rgba(255, 255, 255, 0.6)'],
|
||||
|
||||
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()
|
||||
}
|
||||
}
|
||||
</script>
|
Reference in New Issue
Block a user