两个半圆,点一下转90°,两个颜色

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Title</title>
<style>
.wrap {
border:3px solid black;
width: 200px;
height: 200px;
border-radius: 50%;
overflow: hidden;
margin: 50px auto 0;
position: relative;
background-color: green;
}
.red {
width: 100px;
height: 200px;
position: absolute;
background-color: red;
}
.l {
width: 100px;
height: 200px;
left: 0;
}
.t {
width: 200px;
height: 100px;
top: 0;
}
.r {
width: 100px;
height: 200px;
right: 0;
}
.b {
width: 200px;
height: 100px;
bottom: 0;
}
</style>
</head>
<body>
<div id="app">
<div class="wrap" @click="change" >
<div class="red" :class="red_class" ></div>
</div>
</div>
</body>
<script src="js/vue.js"></script>
<script>
new Vue ({
el:"#app",
data : {
count : 0 ,
red_class:'l',
red_arr :['l','t','r','b']
},
methods:{
change(){
this.count ++;
this.red_class=this.red_arr[this.count %4]
}
},
})
</script>
</html>

homeworkvue的更多相关文章

随机推荐

  1. <Python基础>类和对象(初级)---烧开水的例子

    ''' 类:模板(模子) 类的名称:类名(人) 类的属性:一组数据(年龄,身高) 类的方法:进行操作的方法(走,跑,吃,喝) 对象:实体 类的抽象:把现实中的物品用类去表示 ''' #创建一个类 cl ...

  2. Teigha的BlockTableRecord获取方法

    Teigha的db(即database)可以有很多BlockTableRecord,可以用 OdDbBlockTablePtr blkTbl = db->getBlockTableId().op ...

  3. Codeforces 500D. New Year Santa Network

    题目大意 给你一颗有\(n\)个点的树\(T\),边上有边权. 规定,\(d(i,j)\)表示点i到点j路径上的边权之和. 给你\(q\)次询问,每次询问格式为\(i, j\),表示将按输入顺序排序的 ...

  4. GetCommandLine CmdLineToArgvW

    说明:LPTSTR GetCommandLine(VOID); LPWSTR * CommandLineToArgvW(                                        ...

  5. 关于判断是安卓还是ios环境跳转下载页

    H5项目中判断是安卓还是iOS手机就跳转到不同的下载页,项目如下https://github.com/JserJser/dailyPush/tree/master/daily6/H5 这个项目里面我比 ...

  6. light oj 1068 数位dp

    #include <stdio.h> #include <string.h> #include <stdlib.h> #include <math.h> ...

  7. light oj 1219 树上贪心

    #include <iostream> #include <cstdlib> #include <cstring> #include <queue> # ...

  8. Spring注解驱动开发(六)-----spring容器创建【源码】

    Spring容器的refresh()[创建刷新] 1.prepareRefresh()刷新前的预处理 1).initPropertySources()初始化一些属性设置;子类自定义个性化的属性设置方法 ...

  9. DFS-深度优先搜索与BFS-广度优先搜索

    1.DFS DFS是一个递归过程.(类似于二叉树的前序遍历) 参考:深度优先搜索(Depth-First-Search)精髓 2.BFS 可以理解为按层遍历,借助队列结构来实现.(类似于二叉树的层次遍 ...

  10. idea如何清晰地查看java类的继承结构及该类的所有方法?

    转载自:https://blog.csdn.net/luo609630199/article/details/82192938 我们在世用idea是平时除了编码外,有时我们需要查看源码或者别人写的代码 ...