其他分享
首页 > 其他分享> > vue学习笔记20210601下半场

vue学习笔记20210601下半场

作者:互联网

vue学习笔记20210601下半场

  1. v-once可以有效防止网页端f12界面值的修改
<div id  = "app">
        <h2>{{message}}</h2>
        <h2 v-once>{{message}}</h2>
    </div>

2.v-html对url进行解析
web界面展示标签名

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <div id  = "app">
        <h2 v-html="url">{{url}}</h2>
        <h2>{{message}}</h2>
      
    </div>


    <script src ="../test/vue.js"></script>
    <script>
        const app=new Vue({
               el:'#app',
               data:{   //用于挂载元素
                    message:'你好啊',
                    url:'<a href="http://wwww.baidu.com">百度一下</a>'
               } 
        })
    </script>
</body>
</html>

标签:vue,url,app,下半场,message,20210601
来源: https://blog.csdn.net/weixin_45459322/article/details/117446860