<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
<style>
</style>
</head>
<body>
<div id="app">
<div>{{msg}}</div>
<div>{{reverseString}}</div>
</div>
<script type="text/javascript" src="./js/vue.js"></script>
<script>
var vm = new Vue({
el: '#app',
data: {
msg: 'Hello'
},
computed: {
reverseString: function() {
return this.msg.split('').reverse().join('');
}
}
})
</script>
</body>
</html>
标签:el,vue,computed,前端,vm,35,reverseString,msg,app From: https://blog.51cto.com/u_15460007/6048833