vue指令(4)v-pre

理论知识

  • v-pre用来跳过编译过程,页面中显示原始的变量名称。类似java中的转义字符。

实践

<!DOCTYPE html>
<html>
<head>
    <script type="text/javascript" src="vue.js"></script>
</head>
<body>
    <div id="app">
        <div v-pre>{{ msg1}} </div> //此处不显示123,直接是{{ msg1}}
    </div>
    <script type="text/javascript">
        var app = new Vue({
            el: '#app',
            data:{
                msg1:'123'
            }
        })
    </script>
</body>
</html>

猜你喜欢

转载自www.cnblogs.com/guojuboke/p/12300718.html