<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>变异方法push的留言版实例讲解</title>
<script src="vue.js"></script>
</head>
<body>
<div id="lantian">
<li v-for="v in comments">
{{v.content}}
</li>
<textarea v-model="current_content" rows="10" cols="50"></textarea><br />
<button v-on:click="push">提交</button>
</div>
<script>
var app=new Vue({
el:'#lantian',
data:{
current_content:'',
comments:[
{content:'小二'},
{content:'小三'}
]
},
methods:{
push(){
var content={content:this.current_content};
this.comments.push(content);
this.current_content='';
}
}
});
</script>
</body>
</html>

  

020——VUE中变异方法push的留言版实例讲解的更多相关文章

  1. 20.VUE学习之-变异方法push的留言版实例讲解

    <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8&quo ...

  2. Vue 变异方法Push的留言板实例

    <!doctype html> <html lang="en"> <head> <meta charset="UTF-8&quo ...

  3. 021——VUE中变异方法 push/unshift pop/shift

    <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8&quo ...

  4. vue数组变异方法

    Vue数组变异方法,会改变被这些方法调用的原始数组,将会触发视图更新 push() 接收任意数量的参数,把它们逐个添加到数组末尾,并返回修改后数组的长度 pop() 从数组末尾移除最后一项,减少数组的 ...

  5. 022——VUE中remove()方法的使用:

    <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8&quo ...

  6. Vue中this.$router.push(参数) 实现页面跳转

    很多情况下,我们在执行点击按钮跳转页面之前还会执行一系列方法,这时可以使用 this.$router.push(location) 来修改 url,完成跳转. push 后面可以是对象,也可以是字符串 ...

  7. vue 中 this.$router.push() 路由跳转传参 及 参数接收的方法

    传递参数的方法:1.Params 由于动态路由也是传递params的,所以在 this.$router.push() 方法中 path不能和params一起使用,否则params将无效.需要用name ...

  8. Vue中this.$router.push参数获取(通过路由传参)【路由跳转的方法】

    传递参数的方法: 1.Params 由于动态路由也是传递params的,所以在 this.$router.push() 方法中 path不能和params一起使用,否则params将无效.需要用nam ...

  9. vue中this.$router.push()路由传值和获取的两种常见方法

    1.路由传值   this.$router.push() (1) 路由跳转使用router.push()方法,这个方法会向history栈添加一个新纪录,所以,当用户点击浏览器后退按钮时,会回到之前的 ...

随机推荐

  1. SVN文件版本太旧问题解决

    错误信息如下: E155036: The working copy at '/Users/...' is too old (format 10) to work with client version ...

  2. JAVA BIO与NIO、AIO的区别

    IO的方式通常分为几种,同步阻塞的BIO.同步非阻塞的NIO.异步非阻塞的AIO. 一.BIO 在JDK1.4出来之前,我们建立网络连接的时候采用BIO模式,需要先在服务端启动一个ServerSock ...

  3. 重定向符号和tee命令区别

      来源:http://zyp88.blog.51cto.com/1481591/1604036 功能说明:读取标准输入的数据,并将其内容输出成文件. 语 法:tee [-ai][--help][-- ...

  4. Android模拟器Intel Atom下载安装配置

    https://software.intel.com 在Android x86模拟器Intel Atom x86 System Image时提示Intel execute disable bit(xd ...

  5. SVN主从高可用

    https://blog.csdn.net/conwayli/article/details/80235738

  6. [JavaWeb]关于DBUtils中QueryRunner的一些解读(转)

    QueryRunner类 QueryRunner中提供对sql语句操作的API它主要有三个方法 query() 用于执行select update() 用于执行insert/update/delete ...

  7. MySQL修改max_allowed_packet

    因mysql从库报错Last_IO_Error: Got a packet bigger than 'max_allowed_packet' bytes mysql> show slave st ...

  8. 源码编译nginx

    [root@localhost local]# yum -y install pcre pcre-devel#解压nginx源码包[root@localhost local]# tar -zxvf / ...

  9. webform button

    https://www.codeproject.com/Questions/412553/differences-between-onClick-and-onClientClick OnClick w ...

  10. OAuth Implementation for ASP.NET Web API using Microsoft Owin.

    http://blog.geveo.com/OAuth-Implementation-for-WebAPI2 OAuth is an open standard for token based aut ...