-
Notifications
You must be signed in to change notification settings - Fork 1
/
textarea.vue
61 lines (59 loc) · 1.32 KB
/
textarea.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
52
53
54
55
56
57
58
59
60
61
<template>
<scroller>
<panel title="textarea" type="primary">
<textarea
class="textarea"
autofocus="true"
return-key-type="done"
@return="onreturn"
@change="onchange"
@input="oninput"
/>
<text class="tip">oninput: {{txtInput}}</text>
<text class="tip">onchange: {{txtChange}}</text>
<text class="tip">enter key type: {{returnType}}</text>
<text class="tip">action: {{msg}}</text>
</panel>
</scroller>
</template>
<style scoped>
.textarea {
font-size: 32px;
height: 280px;
width: 400px;
border-width: 2px;
border-color: #ccc;
}
.tip {
font-size: 32px;
margin-top: 20px;
}
</style>
<script>
var modal = weex.requireModule('modal')
module.exports = {
data: function () {
return {
txtInput: '',
txtChange: '',
returnType: '',
msg: ''
}
},
components: {
panel: require('../include/panel.vue')
},
methods: {
onchange: function(event) {
this.txtChange = event.value;
},
oninput: function(event) {
this.txtInput = event.value;
},
onreturn: function(event) {
this.returnType = event.returnKeyType;
this.msg = 'You are "' + this.returnType + '" ' + event.value;
}
}
};
</script>