-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtable.html
50 lines (49 loc) · 1.47 KB
/
table.html
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>
<head>
<meta charset="utf-8">
<title>iview example</title>
<link rel="stylesheet" type="text/css" href="./styles/iview.css">
<script type="text/javascript" src="./js/vue.js"></script>
<script type="text/javascript" src="./js/iview.js"></script>
</head>
<body>
<div id="app">
<i-table :columns="columns" :data="datas"></i-table>
</div>
<script>
var vm = new Vue({
el: '#app',
data: {
columns:[],
datas: [
{name: "张大", age: 13}
],
selectJSON: [
{lable: "1", value:"1"},
{lable: "2", value:"2"},
{lable: "3", value:"3"},
]
},
methods: {
},
created: function(){
console.log(this);
var that = this;
this.$data.columns = [
{title: 'name', key:'name'},
{title: 'age', key:'age', render: function(h, params){
console.log("----------------------------------------");
console.log("这里怎么使用 selectJSON 这个数据");
console.log(this);
console.log(that);
return h('Select', {}, that.$data.selectJSON.map(function(item){
return h('Option', {props:{value: item.value}}, item.label);
}));
}}
];
}
})
</script>
</body>
</html>