Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to implement a Star Evaluation component in vue-star

2025-03-11 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >

Share

Shulou(Shulou.com)05/31 Report--

This article focuses on "how to implement a star evaluation component in vue-star". Interested friends may wish to have a look. The method introduced in this paper is simple, fast and practical. Now let the editor take you to learn "how to implement a star evaluation component in vue-star"!

Create Star.vue under the star folder, and related picture information. Facilitate the nearby maintenance of components

Star.vue:

Const LENGTH = 5; const CLS_ON = 'on'; const CLS_HALF =' half'; const CLS_OFF = 'off'; export default {props: {size: {/ / size, 24authoring 36th type: Number}, score: {type: Number}}, computed: {starSize () {return' star-'+ this.size;}, itemClasses () {let result = []; let score = Math.floor (this.score*2) / 2 / / adjust the value to integer and .5, for example: 4.3 = > 4 4. 6 = > 4. 5 let hasDecimal = score% 1! = = 0; let integer = Math.floor (score); for (let I = 0

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Internet Technology

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report