Skip to content

Commit

Permalink
perf: macro lottie
Browse files Browse the repository at this point in the history
  • Loading branch information
Kaviilee committed Jul 13, 2024
1 parent 62cdfe8 commit b49778a
Showing 1 changed file with 16 additions and 5 deletions.
21 changes: 16 additions & 5 deletions src/components/publish_mark.vue
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
<div v-for="star in stars" class="m-publish-mark" :key="star" @click="onStarClick(star)">
<img :src="imgPath(star)" alt="" svg-inline>
</div>
<i class="u-remove el-icon-remove-outline" title="移除标记" @click="onRemove"></i>
</div>
<div slot="reference" class="m-mark-content" @click="onVisibleChange">
<img v-if="star" :src="imgPath(star)" class="u-mark-img" alt="" svg-inline>
Expand Down Expand Up @@ -53,14 +54,14 @@ export default {
return require(`../assets/img/macro/${star}.svg`);
},
onStarClick(star) {
if (this.star === star) {
this.star = "";
} else {
this.star = star;
}
this.star = star;
this.visible = false;
this.$emit("change", this.star);
},
onRemove() {
this.star = "";
this.$emit("change", this.star);
},
onVisibleChange() {
this.visible = !this.visible;
}
Expand All @@ -85,6 +86,16 @@ export default {
height: 20px;
}
}
.u-remove {
.pointer;
font-size: 18px;
color: #F56C6C;
// 45度旋转
transform: rotate(-45deg);
}
}
.m-mark-content {
height: 40px;
Expand Down

0 comments on commit b49778a

Please sign in to comment.