简单的Vue计算属性
2024-09-01 17:50:29
倒转字符串
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>vue.js的计算属性</title> <script type="text/javascript" src="./js/vue.js"></script>
<script type="text/javascript"> window.onload = function(){
//建立vue对象
var app = new Vue({ el:"#a",
data:{
message : "你好吗"
},
computed:{ reverseMessage:function(){ return this.message.split('').reverse().join('')
}
} });
var a = new Vue({
el:"#q",
data:{
message:"你是谁"
}
}); }
</script> </head>
<body>
<div id="a">
<!-- 颠倒字符串 -->
{{ message }}<br/>
{{ reverseMessage }}
</div>
<div id="q">
{{message.split('').reverse('').join('')}}
</div> </body>
</html>
最新文章
- emoji哈哈哈哈
- AJAX提交方法(POST)Demon
- butterknife简介及Generate ButterKnife Injections 不出现的问题解决
- 【转】SAPI中的IspeechRecoContext(接口)
- [moka同学笔记]linux服务器防火墙的设置
- iOS 使用两个tableview的瀑布流
- 命令行一键清除IE记录
- Postman用法简介-Http请求模拟工具
- HDU 2639 (01背包第k优解)
- Zend框架2入门(二) (转)
- 有用的BitConverter
- mysql设置root密码
- 浅析——SCTP协议(转)
- HttpHelpers类普通GET和POST方式,带Cookie和带证书验证模式
- 理解Vuex的辅助函数mapState, mapActions, mapMutations用法
- ongene database
- JAVA基础关键字小结一
- T-SQL 之 DDL语法
- Python3之redis使用
- 一、异步编程模型(APM)
热门文章
- select rank() over
- 解析underscore中的throttle
- 吴裕雄 Bootstrap 前端框架开发——Bootstrap 字体图标(Glyphicons):glyphicon glyphicon-signal
- 关于无法下载sklearn中的MNIST original数据集的问题
- redis学习(五)
- mvn 编译报错mavn sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested targ
- Windows下C++遍历文件夹中的文件
- InvalidOperationException: Cannot create a DbSet for &#39;IdentityUserClaim<;string>;&#39; because this type is not included in the model for the context.
- Web前端开发CSS规范总结
- Inception Score