Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我需要根据 vuejs 生命周期钩子BeforeCreate和Created更新循环进度条百分比。当记录完全创建时,此进度条必须停止。
您可以通过将循环进度条的 value 属性绑定到一个变量:value="pBarValue"来做到这一点,并在每个钩子处设置所需的百分比,例如:
:value="pBarValue"
beforeCreate() { this.pBarValue = 0; } created() { this.pBarValue = 100; }
并且您可以根据自己的情况使用v-if或v-show,何时要显示它以及何时要隐藏它。请注意,整个过程通常进行得非常快,如果您想查看结果,您可能应该使用console.log!
v-if
v-show
console.log