DemuMesDataV/components/borderBox7/index.vue

67 lines
1.7 KiB
Vue

<template>
<div class="dv-border-box-7" :ref="ref">
<svg class="dv-svg-container">
<polyline class="dv-bb7-line-width-2" :points="`0, 25 0, 0 25, 0`" />
<polyline class="dv-bb7-line-width-2" :points="`${width - 25}, 0 ${width}, 0 ${width}, 25`" />
<polyline class="dv-bb7-line-width-2" :points="`${width - 25}, ${height} ${width}, ${height} ${width}, ${height - 25}`" />
<polyline class="dv-bb7-line-width-2" :points="`0, ${height - 25} 0, ${height} 25, ${height}`" />
<polyline class="dv-bb7-line-width-5" :points="`0, 10 0, 0 10, 0`" />
<polyline class="dv-bb7-line-width-5" :points="`${width - 10}, 0 ${width}, 0 ${width}, 10`" />
<polyline class="dv-bb7-line-width-5" :points="`${width - 10}, ${height} ${width}, ${height} ${width}, ${height - 10}`" />
<polyline class="dv-bb7-line-width-5" :points="`0, ${height - 10} 0, ${height} 10, ${height}`" />
</svg>
<slot></slot>
</div>
</template>
<script>
import borderBoxMixin from '../../mixins/borderBoxMixin.js'
export default {
name: 'BorderBox7',
mixins: [borderBoxMixin],
data () {
return {
ref: `border-box-7-${(new Date()).getTime()}`
}
}
}
</script>
<style lang="less">
@color: fade(gray, 30);
.dv-border-box-7 {
position: relative;
box-shadow: inset 0 0 40px fade(@color, 30);
box-sizing: border-box;
border: 1px solid @color;
padding: 10px;
.dv-svg-container {
position: absolute;
top: 0px;
left: 0px;
width: 100%;
height: 100%;
polyline {
fill: none;
stroke-linecap: round;
}
}
.dv-bb7-line-width-2 {
stroke: @color;
stroke-width: 2;
}
.dv-bb7-line-width-5 {
stroke: fade(gray, 50);
stroke-width: 5;
}
}
</style>