<!DOCTYPE html> <html> <head> <title>Vue Demo</title>

<script src="[https://cdn.jsdelivr.net/npm/[email protected]/dist/vue.js](https://cdn.jsdelivr.net/npm/[email protected]/dist/vue.js)"></script>

</head> <body>

<div id="cp">
    <p>{{ msg }}</p>
    <input v-model="msg">
    <p>{{ reversedMessage }}</p>
</div>

</body><script type="text/javascript">

var app1= new Vue({ el:'#cp', data: { msg:'' },computed: { reversedMessage: function () { return this.msg.split('').reverse().join('') } } })</script>

</html>

01-29 19:25