使用vue怎么實(shí)現(xiàn)一個(gè)環(huán)形進(jìn)度條組件-創(chuàng)新互聯(lián)

使用vue怎么實(shí)現(xiàn)一個(gè)環(huán)形進(jìn)度條組件?針對(duì)這個(gè)問題,這篇文章詳細(xì)介紹了相對(duì)應(yīng)的分析和解答,希望可以幫助更多想解決這個(gè)問題的小伙伴找到更簡(jiǎn)單易行的方法。

創(chuàng)新互聯(lián)公司從2013年創(chuàng)立,是專業(yè)互聯(lián)網(wǎng)技術(shù)服務(wù)公司,擁有項(xiàng)目成都網(wǎng)站建設(shè)、成都網(wǎng)站設(shè)計(jì)網(wǎng)站策劃,項(xiàng)目實(shí)施與項(xiàng)目整合能力。我們以讓每一個(gè)夢(mèng)想脫穎而出為使命,1280元昆都侖做網(wǎng)站,已為上家服務(wù),為昆都侖各地企業(yè)和個(gè)人服務(wù),聯(lián)系電話:028-86922220
<template>
 <svg :height="option.size" :width="option.size" x-mlns="http://www.w3.org/200/svg">
  <circle
   :r="option.radius"
   :cx="option.cx"
   :cy="option.cy"
   :stroke="option.outerColor"
   :stroke-width="option.strokeWidth"
   fill="none"
   stroke-linecap="round"/>
  <circle
   id="progressRound"
   :stroke-dasharray="completenessHandle"
   :r="option.radius"
   :cx="option.cx"
   :cy="option.cy"
   :stroke-width="option.strokeWidth"
   :stroke="option.innerColor"
   fill="none"
   class="progressRound"
  />
 </svg>
</template>
<script>
export default {
 name: 'CommonLoopProgress',
 props: {
  completeness: {
   type: Number,
   required: true,
  },
  progressOption: {
   type: Object,
   default: () => {},
  },
 },
 data () {
  return {
  }
 },
 computed: {
  completenessHandle () {
   let circleLength = Math.floor(2 * Math.PI * this.option.radius)
   let completenessLength = this.completeness * circleLength
   return `${completenessLength},100000000`
  },
  option () {
   // 所有進(jìn)度條的可配置項(xiàng)
   let baseOption = {
    radius: 20,
    strokeWidth: 5,
    outerColor: '#E6E6E6',
    innerColor: '#FFDE00',
   }
   Object.assign(baseOption, this.progressOption)
   // 中心位置自動(dòng)生成
   baseOption.cy = baseOption.cx = baseOption.radius + baseOption.strokeWidth
   baseOption.size = (baseOption.radius + baseOption.strokeWidth) * 2
   return baseOption
  },
 },
}
</script>
<style scoped lang='stylus'>
@import '~stylus/_variables.styl';
@import '~stylus/_mixins.styl';

.progressRound {
 transform-origin: center;
 transform: rotate(-90deg);
 transition: stroke-dasharray 0.3s ease-in;
}
</style>

關(guān)于使用vue怎么實(shí)現(xiàn)一個(gè)環(huán)形進(jìn)度條組件問題的解答就分享到這里了,希望以上內(nèi)容可以對(duì)大家有一定的幫助,如果你還有很多疑惑沒有解開,可以關(guān)注創(chuàng)新互聯(lián)成都網(wǎng)站設(shè)計(jì)公司行業(yè)資訊頻道了解更多相關(guān)知識(shí)。

另外有需要云服務(wù)器可以了解下創(chuàng)新互聯(lián)scvps.cn,海內(nèi)外云服務(wù)器15元起步,三天無理由+7*72小時(shí)售后在線,公司持有idc許可證,提供“云服務(wù)器、裸金屬服務(wù)器、高防服務(wù)器、香港服務(wù)器、美國服務(wù)器、虛擬主機(jī)、免備案服務(wù)器”等云主機(jī)租用服務(wù)以及企業(yè)上云的綜合解決方案,具有“安全穩(wěn)定、簡(jiǎn)單易用、服務(wù)可用性高、性價(jià)比高”等特點(diǎn)與優(yōu)勢(shì),專為企業(yè)上云打造定制,能夠滿足用戶豐富、多元化的應(yīng)用場(chǎng)景需求。

網(wǎng)頁名稱:使用vue怎么實(shí)現(xiàn)一個(gè)環(huán)形進(jìn)度條組件-創(chuàng)新互聯(lián)
文章URL:http://bm7419.com/article26/heojg.html

成都網(wǎng)站建設(shè)公司_創(chuàng)新互聯(lián),為您提供小程序開發(fā)、定制開發(fā)、手機(jī)網(wǎng)站建設(shè)、網(wǎng)站維護(hù)、面包屑導(dǎo)航軟件開發(fā)

廣告

聲明:本網(wǎng)站發(fā)布的內(nèi)容(圖片、視頻和文字)以用戶投稿、用戶轉(zhuǎn)載內(nèi)容為主,如果涉及侵權(quán)請(qǐng)盡快告知,我們將會(huì)在第一時(shí)間刪除。文章觀點(diǎn)不代表本網(wǎng)站立場(chǎng),如需處理請(qǐng)聯(lián)系客服。電話:028-86922220;郵箱:631063699@qq.com。內(nèi)容未經(jīng)允許不得轉(zhuǎn)載,或轉(zhuǎn)載時(shí)需注明來源: 創(chuàng)新互聯(lián)

成都app開發(fā)公司