目录
涉及内容:
随机函数 Math.random()
定时器 setInterval(函数名:时间(单位毫秒))
效果展示:
代码实现
<style>
/* 展示的div的样式 */
.area {
height: 200px;
width: 200px;
background-color: yellow;
line-height: 200px;
color: green;
}
</style>
<!-- 绑定下面的vm模型 -->
<div class="container " id="redom_number">
<!-- 用<center>标签让按钮和文字居中 -->
<center>
<div class="area h1" >{
{div_cover}}</div>
<!-- 开始按钮绑定定时器 -->
<button class="btn btn-primary " @click="start()"> 开始</button>
<!-- 结束按钮清楚定时器 -->
<but