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
| <template>
| <view class="form">
| <input
| type="text"
| placeholder="请输入内容,按下回车确认"
| v-model="inputValue"
| @confirm="addMission"
| />
| </view>
| </template>
|
| <script>
| export default {
| data() {
| return {
| loading: false,
| ContentID: 0,
| inputValue: ''
| }
| },
| methods: {
| addMission(event) {
| const value = this.inputValue.trim();
| if (value === '') {
| uni.showToast({
| title: '请输入内容',
| icon: 'none'
| });
| return;
| }
| this.inputValue = '';
| this.$emit("missionAdded", value);
| }
| }
| }
| </script>
|
| <style scoped>
| .form {
| background: #f7f7f7;
| padding: 10px;
| border-bottom: 1px solid #e5e5e5;
| }
| .form input {
| width: 90%;
| padding: 8px;
| /* box-sizing: border-box; */
| border: 1px solid #ccc;
| border-radius: 4px;
| }
| </style>
|
|