diff --git "a/\351\273\204\345\256\207\347\205\214/5.29 Vue\345\217\202\346\225\260.md" "b/\351\273\204\345\256\207\347\205\214/5.29 Vue\345\217\202\346\225\260.md" new file mode 100644 index 0000000000000000000000000000000000000000..7d9b63585b73d3d8484dddf303fba8674909fc31 --- /dev/null +++ "b/\351\273\204\345\256\207\347\205\214/5.29 Vue\345\217\202\346\225\260.md" @@ -0,0 +1,122 @@ +# Vue + +## v-bind缩写 +``` + +... + + +... + + + ... +``` + +## v-on 缩写 +``` + +... + + +... + + + ... +``` + +## Vue动态参数 +在 DOM 中使用模板时 (直接在一个 HTML 文件里撰写模板),还需要避免使用大写字符来命名键名,因为浏览器会把 attribute 名全部强制转为小写: +``` + +
+``` + +``` +// 后端代码 +let app = new Vue({ + el:"#app", + data() { + return { + url:"http:baidu.com", + count:0, + todo:"href", + todos:["href","http","show","what"] + } + }, + methods: { + btn:function(){ + let rnd = Math.floor(Math.random()*this.todos.length); + console.log(rnd); + return this.todo = this.todos[rnd],this.count+=1 + } + }, +}) +``` + +## 计算属性(computed) +对代码进行简单的运算 +``` + +