diff --git "a/\345\274\240\346\236\227\347\272\242/2021-05-29(\346\250\241\346\235\277\350\257\255\346\263\225).md" "b/\345\274\240\346\236\227\347\272\242/2021-05-29(\346\250\241\346\235\277\350\257\255\346\263\225).md" new file mode 100644 index 0000000000000000000000000000000000000000..a2f0d6855bdd8b8e2eae2ef88b82ead6dc19d174 --- /dev/null +++ "b/\345\274\240\346\236\227\347\272\242/2021-05-29(\346\250\241\346\235\277\350\257\255\346\263\225).md" @@ -0,0 +1,83 @@ +# 模板语法 + +Vue.js使用了基于Html的模板语法,允许开发者声明式地将DOM绑定至最底层Vue实例的数据。所有的Vue.js模板都是合法的HTML,所以能被遵循规范的浏览器和HTML解析式解析。 + +在底层的实现上,Vue将模板编译成虚拟DOM渲染函数。结合响应系统,Vue能够智能地计算出最少需要重新渲染多少组件,并把DOM操作次数减到最少。 + +## 文本 + +数据绑定最常见的形式就是使用“Mustache”语法 (双大括号) 的文本插值: + +{{ msg }} + +通过使用 v-once 指令,也能执行一次性地插值,当数据改变时,插值处的内容不会更新。但请留心这会影响到该节点上的其它数据绑定 + +## 原始HTML + +双大括号会将数据解释为普通文本,而非 HTML 代码。为了输出真正的 HTML,你需要使用 v-html + +``` +
+ {{rawHtml}} + +
+``` +``` + let app=new Vue({ + el:'#app', + data:{ + rawHtml:'

超大字

', + } + }) +``` + +这个 span 的内容将会被替换成为 property 值 rawHtml,直接作为 HTML——会忽略解析 property 值中的数据绑定。注意,你不能使用 v-html 来复合局部模板,因为 Vue 不是基于字符串的模板引擎。反之,对于用户界面 (UI),组件更适合作为可重用和可组合的基本单位。 + + +## 动态参数 +![Image text](./imgs/2021-5-29_1.JPG) +## 计算属性和侦听器 +``` +
+ + 给你点{{msg}}个赞 + + + 这是一个链接 + +
+ + + +``` \ No newline at end of file diff --git "a/\345\274\240\346\236\227\347\272\242/imgs/2021-5-29_1.JPG" "b/\345\274\240\346\236\227\347\272\242/imgs/2021-5-29_1.JPG" new file mode 100644 index 0000000000000000000000000000000000000000..1bb7d1b2cb3249ea1c13daeea094edf92a60a7bf Binary files /dev/null and "b/\345\274\240\346\236\227\347\272\242/imgs/2021-5-29_1.JPG" differ diff --git "a/\345\274\240\346\236\227\347\272\242/imgs/5.29/2021-5-29 15-18-50.JPG" "b/\345\274\240\346\236\227\347\272\242/imgs/5.29/2021-5-29 15-18-50.JPG" new file mode 100644 index 0000000000000000000000000000000000000000..83f9eda566336450484c2e849257a16721109594 Binary files /dev/null and "b/\345\274\240\346\236\227\347\272\242/imgs/5.29/2021-5-29 15-18-50.JPG" differ diff --git "a/\345\274\240\346\236\227\347\272\242/imgs/5.29/2021-5-29 15-27-14.JPG" "b/\345\274\240\346\236\227\347\272\242/imgs/5.29/2021-5-29 15-27-14.JPG" new file mode 100644 index 0000000000000000000000000000000000000000..02cad69af669b167e2123cda334d29ce24ac48f7 Binary files /dev/null and "b/\345\274\240\346\236\227\347\272\242/imgs/5.29/2021-5-29 15-27-14.JPG" differ diff --git "a/\345\274\240\346\236\227\347\272\242/imgs/5.29/2021-5-29 15-27-30.JPG" "b/\345\274\240\346\236\227\347\272\242/imgs/5.29/2021-5-29 15-27-30.JPG" new file mode 100644 index 0000000000000000000000000000000000000000..64329644a369a71a0b4f5ac7846a25d01ca107fe Binary files /dev/null and "b/\345\274\240\346\236\227\347\272\242/imgs/5.29/2021-5-29 15-27-30.JPG" differ diff --git "a/\345\274\240\346\236\227\347\272\242/imgs/5.29/2021-5-29 15-39-5.JPG" "b/\345\274\240\346\236\227\347\272\242/imgs/5.29/2021-5-29 15-39-5.JPG" new file mode 100644 index 0000000000000000000000000000000000000000..018ebbea5f5253a9d4f43bb917b36d27c51aa4bb Binary files /dev/null and "b/\345\274\240\346\236\227\347\272\242/imgs/5.29/2021-5-29 15-39-5.JPG" differ diff --git "a/\345\274\240\346\236\227\347\272\242/imgs/5.29/2021-5-29 15-40-47.JPG" "b/\345\274\240\346\236\227\347\272\242/imgs/5.29/2021-5-29 15-40-47.JPG" new file mode 100644 index 0000000000000000000000000000000000000000..e0f1adece88431b8313a492a8e4f47d0f6e6700f Binary files /dev/null and "b/\345\274\240\346\236\227\347\272\242/imgs/5.29/2021-5-29 15-40-47.JPG" differ diff --git "a/\345\274\240\346\236\227\347\272\242/imgs/5.29/2021-5-29 16-18-25.JPG" "b/\345\274\240\346\236\227\347\272\242/imgs/5.29/2021-5-29 16-18-25.JPG" new file mode 100644 index 0000000000000000000000000000000000000000..dcf45176f3d488a5fae51376f8a85674d0362108 Binary files /dev/null and "b/\345\274\240\346\236\227\347\272\242/imgs/5.29/2021-5-29 16-18-25.JPG" differ diff --git "a/\345\274\240\346\236\227\347\272\242/imgs/5.29/2021-5-29 16-19-41.JPG" "b/\345\274\240\346\236\227\347\272\242/imgs/5.29/2021-5-29 16-19-41.JPG" new file mode 100644 index 0000000000000000000000000000000000000000..a668ee1df71571d80c72dd95da8873269c2f06d4 Binary files /dev/null and "b/\345\274\240\346\236\227\347\272\242/imgs/5.29/2021-5-29 16-19-41.JPG" differ