vue中refs具体用法
来源:互联网 发布:office2016英文版 mac 编辑:程序博客网 时间:2024/05/17 04:01
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Document</title>
</head>
<body>
<div id="app">
<input type="text" ref="input1">
<!-- 给标签添加一个ref属性。任意标签都可以-->
<button @click="add()">提交</button>
</div>
</body>
</html>
<script>
var vm = new Vue({
el:"#app",
methods:{
add:function () {
this.$refs.input.value="22"
// this指当前的vue实例对象 也就是vm
// .$refs指页面中标签具有ref属性的标签
// 这样做可以减少获取dom节点的消耗
}
}
})
</script>
阅读全文
0 0
- vue中refs具体用法
- vue-ref-$refs用法
- Vue $refs的基本用法
- Vue $refs的基本用法
- vue $refs的基本用法
- vue $refs的基本用法
- Vue.js之$refs
- vue.js$nextTick中具体的了解
- DataList 控件具体用法 (中)
- git中refs/for 和refs/heads
- vue组件($children,$refs,$parent)的使用
- vue组件($children,$refs,$parent)的使用
- Vue之ref与refs的使用
- vue中appear的用法
- vue中solt 的用法
- vue 中nextTick的用法
- vue 中 ref 的用法
- asp中session的具体用法
- 网络流模板
- 分析Android中应用的启动流程
- 基础技术篇 8 —— iBeacon技术详解与应用
- socket()函数介绍
- Language: Cable master Time Limit: 1000MSMemory Limit: 10000K Total Submissions: 46653Accepted:
- vue中refs具体用法
- 对象,数组,傻傻分不清楚
- 定义一个只能在堆上生成对象的类&&定义一个只能在栈上生成对象的类&&定义一个类不能被继承
- ch5 指针、数组和结构
- 图
- Unix下zfs文件系统重组RAID-5恢复方法
- linux跨服务器复制文件夹
- 排序(1)
- mysql(mycat)执行sql报nullpointerException