Vue学习笔记
第一章 Vue核心
01 Vue简介
vue是什么?
一套用于构建用户界面的渐进式JavaScript框架
构建用户界面:数据——》界面
渐进式:vue可以自底向上逐层的应用
谁开发的?
尤雨溪
Vue的特点
- 采用组件化模式,提供代码复用率,且让代码更高维护。
- 声明式编码,让编码人员无需直接操作DOM,提高开发效率。
- 使用虚拟DOM+优秀的Diff算法,尽量复用DOM节点。
学习Vue之前要掌握的JavaScript基础知识?
ES6语法规范
ES6模块化
包管理器
原型,原型链
数组常用方法
axios
promise
……
02 初始Vue
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51
| <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>初识Vue</title> <link rel="icon" href="../apple.ico" type="image/png"> <script type="text/javascript" src="../js/vue.js"></script> </head> <body>
<div id="root"> <h1>Hello,{{name.toUpperCase()}},{{address}}</h1> </div> <script type="text/javascript"> Vue.config.productionTip = false
new Vue({ el:'#root', data:{ name:'yyb', address:'陕西杨凌', } }) </script> </body> </html>
|
03 模版语法
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50
| <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>模版语法</title> <script type="text/javascript" src="../js/vue.js"></script> </head> <body>
<div id="root"> <h1>插值语法</h1> <h3>你好,{{name}}</h3> <hr/> <h1>指令语法</h1> <a v-bind:href="school.url.toUpperCase()" x="hello">点击进入{{school.name}}的博客</a> <a :href="school.url" x="hello">点击进入{{school.name}}的博客</a> </div> </body>
<script type="text/javascript"> Vue.config.productionTip = false
new Vue({ el:'#root', data:{ name:'jack', school:{ name:'yyb', url:'https://spongebobyyb.github.io/', } } }) </script>
</html>
|
参考资料
003_尚硅谷Vue技术_Vue官网使用指南_哔哩哔哩_bilibili