npm install vant -S
import 'vant/lib/index.css';
<van-progress :percentage="50" />
<template> <div> <van-progress :percentage="progress" /> <van-button @click="increaseProgress">增加进度</van-button> </div> </template> <script> import { Progress, Button } from 'vant'; export default { components: { [Progress.name]: Progress, [Button.name]: Button }, data() { return { progress: 50 }; }, methods: { increaseProgress() { this.progress += 10; } } }; </script>
本文为翻滚的胖子原创文章,转载无需和我联系,但请注明来自猿教程iskeys.com