vuejs里面v-if,v-show和v-for
<div id='root'>
<div v-if='show'>helle world</div>
<button @click='handleClick'>toggle</button>
</div>
<script>
new Vue({
el:'#root',
data:{
show:true
},
methods:{
handleClick:function(){
this.show = !this.show;
}
}
})
</script>
<div id='root'>
<div v-show='show'>helle world</div>
<button @click='handleClick'>toggle</button>
</div>
<script>
new Vue({
el:'#root',
data:{
show:true
},
methods:{
handleClick:function(){
this.show = !this.show;
}
}
})
</script>
v-show,把v-show替换掉v-if,表现形式一样,但是和v-if不同的是,v-show只是将dom隐藏,显示,并没有移除dom,只是把display的样式变了
<div id='root'>
<ul>
<li v-for='item of list' :key='item'>{{item}}</li>
</ul>
</div>
<script>
new Vue({
el:'#root',
data:{
list:[1,2,3]
}
})
</script>
vuejs里面v-if,v-show和v-for的更多相关文章
- 证明 U and V={0}时 dim(U+V)=dim(U)+dim(V)
U And V={0} 证明 dim(U+V)=dim(U)+dim(V)设{u1,u2,...,uk} 是U的基,{v1,v2...,vr}是V的基,dim(U)=k ,dim(V)=r dim(U ...
- client version is higher than daemon version (client is v.1.29 daemon is v.1.22)
安装好coreseek,建了索引,启动了服务,用php建了一个test.php,用于测试:<?phpinclude_once('sphinxapi.php');//向搜索引擎发起请求 $cl = ...
- 操作系统中的P,V操作(转)
无论是计算机考研.计算机软件水平考试.计算机操作系统期末考试还是其他计算机岗位考试,P.V原语操作都是一个常考点.下面笔者总结了关于P.V操作的一些知识. 信号量是最早出现的用来解决进程同步与互斥问题 ...
- XVI Open Cup named after E.V. Pankratiev. GP of Peterhof
A. (a, b)-Tower 当指数大于模数的时候用欧拉定理递归计算,否则直接暴力计算. #include<cstdio> #include<algorithm> #incl ...
- XVI Open Cup named after E.V. Pankratiev. GP of Siberia
A. Passage 枚举两个点,看看删掉之后剩下的图是否是二分图. #include <bits/stdc++.h> using namespace std ; const int MA ...
- XVI Open Cup named after E.V. Pankratiev. GP of Ekaterinburg
A. Avengers, The 留坑. B. Black Widow 将所有数的所有约数插入set,然后求mex. #include<bits/stdc++.h> using names ...
- XVI Open Cup named after E.V. Pankratiev. GP of Eurasia
A. Nanoassembly 首先用叉积判断是否在指定向量右侧,然后解出法线与给定直线的交点,再关于交点对称即可. #include<bits/stdc++.h> using names ...
- XVI Open Cup named after E.V. Pankratiev. GP of SPB
A. Bubbles 枚举两个点,求出垂直平分线与$x$轴的交点,答案=交点数+1. 时间复杂度$O(n^2\log n)$. #include<cstdio> #include<a ...
- XIV Open Cup named after E.V. Pankratiev. GP of SPb
A. Bracket Expression 直接按题意模拟即可. 时间复杂度$O(n)$. #include<stdio.h> #include<algorithm> #inc ...
- XIII Open Cup named after E.V. Pankratiev. GP of Ukraine
A. Automaton 后缀自动机可以得到$O(2n+1)$个状态,但是后缀自动机会拒绝接收所有不是$S$的子串的串,所以在建立后缀自动机的时候不复制节点即可得到$n+1$个状态的DFA. #inc ...
随机推荐
- nginx 安装遇到的问题
今天想学学 nginx,于是先把它安装起来.按照 http://nginx.org/en/linux_packages.html 上面的方法,在我的 ubuntu 虚拟机上很容易地就安装好了.可是要运 ...
- 清北刷题冲刺 11-01 a.m
立方体 /* 输入数据中的p的位置是没有用的,而题目本质上是求C(n,k) */ #include<iostream> #include<cstdio> #define mod ...
- Luogu P4551 最长异或路径 01trie
做一个树上前缀异或和,然后把前缀和插到$01trie$里,然后再对每一个前缀异或和整个查一遍,在树上从高位向低位贪心,按位优先选择不同的,就能贪出最大的答案. #include<cstdio&g ...
- Knight Tournament (set)
Hooray! Berl II, the king of Berland is making a knight tournament. The king has already sent the me ...
- NetworkUtils
import java.io.IOException; import javax.servlet.http.HttpServletRequest; import org.apache.log4j.Lo ...
- GUI的最终选择 Tkinter(五):Text用法
Text组件 绘制单行文本使用Label组件,多行选使用Listbox,输入框使用Entry,按钮使用Button组件,还有Radiobutton和Checkbutton组件用于提供单选或多选的情况, ...
- onCreateOptionsMenu
onCreateOptionsMenu----只在Activity创建时调用一次!之后不会再被调用! onPrepareOptionsMenu----每次display menu之前,都會调用该方法, ...
- Problem Statement
题目链接:https://vjudge.net/contest/239445#problem/E E - Problem Statement You are given nn strings ...
- python 发布
使用distutils.core.setup函数发布程序 将要发布的包放到mypub的目录下 在mypub目录下创建一个setup.py文件 setup.py文件的设置 from distutils. ...
- Docker | 第五章:构建自定义镜像
前言 上一章节,主要是介绍了下Dockerfile的一些常用命令的说明.我们知道,利用Dockerfile可以构建一个新的镜像,比如运行Java环境,就需要一个JDK环境的镜像,但直接使用公共的镜像时 ...