demo 原始链接:https://vux.li/demos/v2/#/component/x-circle
\n下面的$t是Demo的i18n使用的翻译函数,一般情况下可以直接使用字符串。另外,下面代码隐藏了i18n标签部分的代码。
\n<template>\n <div class=\"vux-circle-demo\">\n <br>\n <div style='width:150px;height:150px;'>\n <x-circle :percent=\"percent1\" :stroke-width=\"10\" stroke-color=\"#04BE02\">\n <span>{{percent1}}</span>\n </x-circle>\n </div>\n <br>\n <div style='width:100px;height:100px;'>\n <x-circle :percent=\"percent1\" :stroke-width=\"5\" stroke-color=\"#04BE02\">\n <span>{{percent1}}</span>\n </x-circle>\n </div>\n <br>\n <div style='width:50px;height:50px;'>\n <x-circle :percent=\"percent1\" :stroke-width=\"5\" stroke-color=\"#04BE02\">\n <span>{{percent1}}</span>\n </x-circle>\n </div>\n <br>\n <div style=\"width:180px;\">\n <range v-model=\"percent1\" :min=\"0\" :max=\"100\"></range>\n </div>\n <br>\n <div style='width:100px;height:100px;'>\n <x-circle :percent=\"100\" :stroke-width=\"3\" stroke-color=\"#04BE02\">\n <icon type=\"success\"></icon>\n </x-circle>\n </div>\n <br>\n <div style='width:100px;height:100px;'>\n <x-circle :percent=\"percent2\" :stroke-width=\"6\" :trail-width=\"6\" :stroke-color=\"strokeColor2\" trail-color=\"#ececec\">\n <span :style=\"{color: strokeColor2}\">{{percent2}}%</span>\n </x-circle>\n </div>\n </div>\n</template>\n\n<script>\nimport { XCircle, Range, Icon } from 'vux'\n\nexport default {\n ready () {\n setInterval(this.update2, 2000)\n },\n components: {\n XCircle,\n Range,\n Icon\n },\n data () {\n return {\n percent1: 10,\n percent2: 30,\n strokeColor2: '#3FC7FA'\n }\n },\n methods: {\n update2 () {\n const colorMap = ['#3FC7FA', '#85D262', '#FE8C6A']\n this.percent2 = parseInt(Math.random() * 100, 10)\n this.strokeColor2 = colorMap[parseInt(Math.random() * 3, 10)]\n }\n }\n}\n</script>\n\n<style scoped>\n.vux-circle-demo {\n text-align: center;\n}\n.vux-circle-demo > div {\n margin: 0 auto;\n}\n</style>\n\n
\n