computed计算属性
原创wg_iGBFcBFB 博主文章分类:vue ©著作权
©著作权归作者所有:来自51CTO博客作者wg_iGBFcBFB的原创作品,请联系作者获取转载授权,否则将追究法律责任
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>computed计算属性</title>
</head>
<body>
<div id="app">
<input type="text" v-model='text'>
<br>
<span >{{toUp}}</span>
</div>
<script src="../node_modules/vue/dist/vue.js"></script>
<script>
let vm = new Vue({
el: "#app",
data: {
text:''
},
computed:{
toUp(){
return 'eric' + this.text
}
}
});
</script>
</body>
</html>
下一篇:文字
提问和评论都可以,用心的回复会被更多人看到
评论
发布评论
相关文章
-
vue 计算属性computed ,watchervue 其他
-
vue之计算属性computed模板
计算属性:故名思意也是一种属性,可以用插值表达式直接调用 废话不多说,直接上代码: 页面部分 <!-- 用户名下拉
ico 插值 下拉菜单 用户名 ide -
【Vue】computed方法生成计算属性
computed方法生成计算属性
vue.js computed 计算属性 set方法 赋值 代码示例