DemuMesDataV/components/borderBox2/index.vue

72 lines
1.3 KiB
Vue
Raw Normal View History

2019-01-16 16:56:11 +08:00
<template>
<div class="dv-border-box-2" :ref="ref">
<svg class="dv-border-svg-container">
<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" />
</svg>
2019-06-25 19:57:04 +08:00
<div class="border-box-content">
<slot></slot>
</div>
2019-01-16 16:56:11 +08:00
</div>
</template>
<script>
2019-06-25 19:57:04 +08:00
import autoResize from '../../mixins/autoResize.js'
2019-01-16 16:56:11 +08:00
export default {
name: 'BorderBox2',
2019-06-25 19:57:04 +08:00
mixins: [autoResize],
2019-01-16 16:56:11 +08:00
data () {
return {
2019-06-25 19:57:04 +08:00
ref: 'border-box-2'
2019-01-16 16:56:11 +08:00
}
}
}
</script>
<style lang="less">
.dv-border-box-2 {
position: relative;
2019-06-25 19:57:04 +08:00
width: 100%;
height: 100%;
2019-01-16 16:56:11 +08:00
.dv-border-svg-container {
position: absolute;
width: 100%;
height: 100%;
top: 0px;
left: 0px;
polyline {
fill: none;
stroke-width: 1;
}
circle {
fill: #fff;
}
}
.dv-bb2-line1 {
stroke: #fff;
}
.dv-bb2-line2 {
stroke: fade(#fff, 60);
}
2019-06-25 19:57:04 +08:00
.border-box-content {
position: relative;
width: 100%;
height: 100%;
}
2019-01-16 16:56:11 +08:00
}
</style>