DemuMesDataV/components/borderBox6/index.vue

65 lines
1.7 KiB
Vue
Raw Normal View History

2018-12-08 16:05:04 +08:00
<template>
2019-01-16 16:56:11 +08:00
<div class="dv-border-box-6" :ref="ref">
<svg class="dv-svg-container">
2018-12-08 16:05:04 +08:00
<circle cx="5" cy="5" r="2"/>
<circle :cx="width - 5" cy="5" r="2" />
<circle :cx="width - 5" :cy="height - 5" r="2" />
<circle cx="5" :cy="height - 5" r="2" />
<polyline :points="`10, 4 ${width - 10}, 4`" />
<polyline :points="`10, ${height - 4} ${width - 10}, ${height - 4}`" />
<polyline :points="`5, 70 5, ${height - 70}`" />
<polyline :points="`${width - 5}, 70 ${width - 5}, ${height - 70}`" />
<polyline :points="`3, 10, 3, 50`" />
<polyline :points="`7, 30 7, 80`" />
<polyline :points="`${width - 3}, 10 ${width - 3}, 50`" />
<polyline :points="`${width - 7}, 30 ${width - 7}, 80`" />
<polyline :points="`3, ${height - 10} 3, ${height - 50}`" />
<polyline :points="`7, ${height - 30} 7, ${height - 80}`" />
<polyline :points="`${width - 3}, ${height - 10} ${width - 3}, ${height - 50}`" />
<polyline :points="`${width - 7}, ${height - 30} ${width - 7}, ${height - 80}`" />
</svg>
<slot></slot>
</div>
</template>
<script>
2019-01-16 16:56:11 +08:00
import borderBoxMixin from '../../mixins/borderBoxMixin.js'
2018-12-08 16:05:04 +08:00
export default {
name: 'BorderBox6',
2019-01-16 16:56:11 +08:00
mixins: [borderBoxMixin],
2018-12-08 16:05:04 +08:00
data () {
return {
2019-01-16 16:56:11 +08:00
ref: `border-box-6-${(new Date()).getTime()}`
2018-12-08 16:05:04 +08:00
}
}
}
</script>
<style lang="less">
2019-01-16 16:56:11 +08:00
.dv-border-box-6 {
2018-12-08 16:05:04 +08:00
position: relative;
box-sizing: border-box;
padding: 10px;
2019-01-16 16:56:11 +08:00
.dv-svg-container {
2018-12-08 16:05:04 +08:00
position: absolute;
top: 0px;
left: 0px;
width: 100%;
height: 100%;
circle {
fill: gray;
}
polyline {
fill: none;
stroke-width: 1;
stroke: fade(#fff, 35);
}
}
}
</style>