Vue技术15.5v-pre指令

<!DOCTYPE html>
<html>
    <head>
        <mata charset="UTF-8" />
        <title>v-pre指令</title>
        <script type="text/javascript" src="../js/vue.js"></script>
    </head>
    <body>
        <!--
            v-pre指令:
                1.跳过其所在节点的编译过程。
                2.可利用它跳过:没有使用指令语法、没有使用插值语法的节点,会加快编译。
         -->
        <!-- 准备好一个容器 -->
        <div id="root">
            <h2 v-pre>Vue其实很简单</h2>
            <h2 v-pre>当前的n值是:{
   
   {n}}</h2>
            <button v-pre @click="n++">点我n+1</button>
        </div>
    </body>

    <script type="text/javascript">
        Vue.config.productionTip = false

        new Vue({
      
      
            el:'#root',
            data:{
      
      
                n:1
            }
        })
    </script>
</html>

猜你喜欢

转载自blog.csdn.net/qq_40713201/article/details/126295881