# 聊天输入框组件开发
<template>
<view class="user-chat-bottom u-f-ac">
<input type="text" placeholder="文明发言" v-model="text"/>
<view class="icon iconfont icon-fabu u-f-ajc" @tap="submit"></view>
</view>
</template>
<script>
export default {
data(){
return {
text: ''
}
},
methods: {
submit(){
this.$emit('submit',this.text)
this.text = ""
}
}
}
</script>
<style lang="less" scoped>
.user-chat-bottom {
position: fixed;
bottom: 0;
left: 0;
right: 0;
height: 120rpx;
padding: 0 20rpx;
background-color: #fff;
border-top: 1rpx solid #eee;
input {
flex: 1;
margin-right: 20rpx;
padding: 10rpx 20rpx;
border-radius: 10rpx;
background-color: #f7f7f7;
}
view {
width: 80rpx;
font-size: 45rpx;
}
}
</style>
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
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