/* 2-7行代码; 【template: 模板】
一个template下只能有一个孩子; 孩子可以有多个孙子 */
// 25_模板语法 //
{{ msg }}
{{number+1}}
// 26_常用内置基本指令 //
试试就试试!
大哥你赢了!
试试就试试!!!
// 27_n.js下, 自定义指令 //
// 28_计算属性; 29_样式与循环 //
我借你{{money}}, 你还我{{h}}, 还剩{{s}}
style object
// 29_列表渲染 //
/* 9-22行代码【script: 脚本】 */
export default {
name: 'HelloWorld',
props: {
msg: String
},
data () {
return {
msg1: "再瞅一个试试!",
id: 'txt',
number: 1,
seen: false,
money: 1000,
h: 10,
a1: 'test-1',
a2: 'test-2',
a3: false,
obj: {
'test-1': false
},
/* 29_列表渲染 */
list: ['a','b','c','d']
}
},
/* 28_计算属性 */
computed: {
s: function(){
return this.money - this.h
}
}
}
/* 25-41行代码【style: 样式】 */
h1, h2 {
font-weight: normal;
}
ul {
list-style-type: none;
padding: 0;
}
li {
display: inline-block;
margin: 0 10px;
}
a {
color: #42b983;
}