forked from apache/incubator-weex
-
Notifications
You must be signed in to change notification settings - Fork 0
/
ui.we
67 lines (59 loc) · 2.62 KB
/
ui.we
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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
<template>
<scroller>
<wxc-panel title="Title Levels" type="primary">
<wxc-hn repeat="{{levels}}" level="{{level}}" value="H{{level}}, Level {{level}}"></wxc-hn>
</wxc-panel>
<wxc-panel title="Buttons" append="tree" type="primary">
<div style="flex-direction: row; margin-top: 12px" repeat="{{buttons}}">
<wxc-button type="{{type}}" size="large" value="{{type}}" onclick="{{clicked}}" style=""></wxc-button>
<wxc-button type="{{type}}" size="middle" value="{{type}}" onclick="{{clicked}}"
style="margin-left:5px;width:210px;"></wxc-button>
<wxc-button type="{{type}}" size="small" value="{{type}}" onclick="{{clicked}}"
style="margin-left:5px;"></wxc-button>
</div>
<!--<div style="flex-direction: row; margin-top: 12px">-->
<!--<wxc-button disabled="{{true}}" type="" size="large" value="Disabled" onclick="{{clicked}}"></wxc-button>-->
<!--<wxc-button disabled="{{false}}" type="primary" size="large" value="Enabled" onclick="{{clicked}}"-->
<!--style="margin-left: 12px"></wxc-button>-->
<!--</div>-->
</wxc-panel>
<wxc-panel title="Panels" type="primary">
<wxc-panel repeat="{{panels}}" title="Panels-{{type}}" type="{{type}}" border="1"
style="margin-left: 12px;margin-right: 12px;">
<text>Panels {{type}} content. Panels {{type}} content. Panels {{type}} content.</text>
</wxc-panel>
</wxc-panel>
<wxc-panel title="List" type="primary">
<wxc-list-item repeat="{{tips}}" onclick="{{clicked}}">
<text class="item-txt">{{type}}</text>
</wxc-list-item>
</wxc-panel>
<wxc-panel title="Tips" type="primary">
<wxc-tip repeat="{{tips}}" style="margin-bottom: 20px;"
value="Panels {{type}} content. Panels {{type}} content. Panels {{type}} content."></wxc-tip>
</wxc-panel>
</scroller>
</template>
<script>
require('weex-components');
module.exports = {
data: {
levels: [{level: 1}, {level: 2}, {level: 3}],
buttons: [{type: 'default'}, {type: 'primary'}, {type: 'success'}, {type: 'info'}, {type: 'warning'}, {type: 'danger'}, {type: 'link'}],
panels: [{type: 'default'}, {type: 'primary'}, {type: 'success'}, {type: 'info'}, {type: 'warning'}, {type: 'danger'}],
tips: [{type: 'success'}, {type: 'info'}, {type: 'warning'}, {type: 'danger'}],
},
methods: {
clicked: function() {
var $modal = require('@weex-module/modal');
$modal.toast({'message': 'clicked!', duration: 0.5});
}
}
}
</script>
<style>
.item-txt {
font-size: 48px;
color: #555555;
}
</style>