File tree 2 files changed +27
-24
lines changed 2 files changed +27
-24
lines changed Original file line number Diff line number Diff line change 5
5
<div >
6
6
{{ entry.response }}
7
7
</div >
8
+ <div v-if =" entry.error" class =" p-2" >
9
+ <el-alert
10
+ title =" Kosa"
11
+ :description =" entry.error"
12
+ type =" error"
13
+ :closable =" false" />
14
+ </div >
8
15
</div >
9
- <el-input v-model =" input" @keyup.enter =" sendToEngine" ></el-input >
16
+ <el-input
17
+ v-model =" input"
18
+ @keyup.enter =" sendToEngine"
19
+ placeholder =" Andika msimbo" ></el-input >
10
20
</div >
11
21
</template >
12
22
@@ -17,37 +27,25 @@ export default {
17
27
data () {
18
28
return {
19
29
input: " " ,
20
- entries: [
21
- {
22
- input: " x + 2" ,
23
- response: " 2" ,
24
- },
25
- ],
30
+ entries: [],
26
31
};
27
32
},
28
33
methods: {
29
34
sendToEngine () {
30
- console .log (" im there" );
31
-
32
- Start (this .input )
33
- .then ((resp , other ) => {
34
- console .log (" im here" );
35
- this .createNewEntry (this .input , resp);
36
- console .log (resp);
37
- console .log (" other" , other);
38
- })
39
- .catch ((error ) => {
40
- console .log (error);
41
-
42
- this .createNewEntry (this .input , error);
43
- console .log (" im failed" );
44
- });
45
- console .log (" im done" );
35
+ Start (this .input ).then ((resp ) => {
36
+ if (resp .Errors ) {
37
+ this .createNewEntry (this .input , " " , resp .Errors [0 ]);
38
+ } else {
39
+ this .createNewEntry (this .input , resp .Evaluated , " " );
40
+ }
41
+ this .input = " " ;
42
+ });
46
43
},
47
- createNewEntry (item , respone ) {
44
+ createNewEntry (item , respone , error ) {
48
45
this .entries .push ({
49
46
input: item,
50
47
response: respone,
48
+ error: error,
51
49
});
52
50
},
53
51
},
Original file line number Diff line number Diff line change 183
183
text-align : left;
184
184
padding : 20px ;
185
185
}
186
+
187
+
188
+ .p-2 {
189
+ padding : 10px 0px ;
190
+ }
You can’t perform that action at this time.
0 commit comments