可以在`.item`的样式中加上`margin: -1.5px 0 0 -1.5px;`,同时将`.circle`的`border-radius`属性改为`calc(50% - 10px)`,即可将线条缩短并距离最外层盒子10px,修改后的代码如下所示:
```html
<template>
<div class="circle">
<div v-for="item in 50" class="item" :style="{ transform: `rotate(${item * 3.6}deg)` }"></div>
<div class="top"></div>
</div>
</template>
<style lang="less">
.circle {
position: relative;
width: 86%;
height: 86%;
left: 7%;
top: 7%;
border-radius: calc(50% - 10px);
.top {
position: absolute;
width: 100%;
height: 100%;
left: 5%;
top: 5%;
border-radius: 50%;
background-color: rgba(255, 255, 255);
}
.item {
width: 100%;
height: 3px;
background-color: rgba(255, 255, 255, 0.5);
position: absolute;
left: 0%;
top: 50%;
margin: -1.5px 0 0 -1.5px;
}
}
</style>
```