<view>
<canvas canvas-id="master" id="canvas" :style="style">
<cover-view class="cover-view">
<!-- 角线 -->
<cover-view class="touch-area left top"></cover-view>
<cover-view class="touch-area right top"></cover-view>
<cover-view class="touch-area left bottom"></cover-view>
<cover-view class="touch-area right bottom"></cover-view>
<!-- 辅助线 -->
<cover-view class="pa line-vertical-one"></cover-view>
<cover-view class="pa line-vertical-two"></cover-view>
<cover-view class="pa line-horizontal-one"></cover-view>
<cover-view class="pa line-horizontal-two"></cover-view>
</cover-view>
</canvas>
</view>
#canvas{
border: 1rpx solid white;
}
.pa{
position: absolute;
background-color: white;
}
.cover-view{
width: 100%;
height: 100%;
position: relative;
padding: 0;
border: 2px solid yellow;
box-sizing: border-box;
.touch-area{
width: 50rpx;
height: 50rpx;
position: absolute;
background-color: yellow;
box-sizing: border-box;
}
.left{
border-left: 20px solid red;
left: 0;
}
.top{
border-top: 20px solid red;
top: 0;
}
.right{
border-right: 20px solid red;
right: 0;
}
.bottom{
border-bottom: 20px solid red;
bottom: 0;
}
.line-vertical-one{
width: 1px;
left: 33.3%;
height: 100%;
}
.line-vertical-two{
width: 1px;
left: 66.7%;
height: 100%;
}
.line-horizontal-one{
height: 1px;
top: 33.3%;
width: 100%;
}
.line-horizontal-two{
height: 1px;
top: 66.7%;
width: 100%;
}
}