Vue reverse a string

<div id="app">
            <p>{{hello}}</p>
            <button @click="click">反转信息</button>
        </div>

To write the contents (content inversion) within <p> tags;

<Button> button, a click event to write

< Script > 
            new new Vue ({ 
                EL: " #app " , 
                Data: { 
                    Hello: ' I'm afraid you afraid I ' 
                }, 
                Methods: { 
                    the Click: function () {
                         the this .hello = the this .hello.split ( '' ) . .reverse () the Join ( '' ) // character inverts; 
                    } 
                } 
            }) 
        </ Script >

Guess you like

Origin www.cnblogs.com/a973692898/p/12106087.html