Skip to content

Commit e9d60e2

Browse files
committed
update display order
1 parent 9c820d3 commit e9d60e2

File tree

6 files changed

+40
-50
lines changed

6 files changed

+40
-50
lines changed

src/App.vue

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
<slot></slot>
1010
</display-current-order>
1111
<hr>
12-
12+
<display-order><slot></slot></display-order>
1313
</div>
1414
</div>
1515

@@ -29,6 +29,7 @@
2929
import Vue from 'vue';
3030
3131
Vue.component('make-order', require('./components/make-order').default);
32+
Vue.component('display-order', require('./components/display-order').default);
3233
Vue.component('display-customers', require('./components/display-customers').default);
3334
Vue.component('display-current-order', require('./components/display-current-order').default);
3435
Vue.component('display-events', require('./components/display-events').default);

src/components/display-current-order.vue

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,14 @@
11
<template>
22
<div>
3-
<table>
4-
<tr>
5-
6-
</tr>
7-
</table>
3+
Your Order: {{userName}} - {{foodOrder}} ::: Status == {{actionStatus}}
84
</div>
95

106
</template>
117

128
<script>
139
export default {
1410
name: "display-current-order",
15-
props: ['currentOrder']
11+
props:['userName','foodOrder','actionStatus']
1612
}
1713
</script>
1814

src/components/display-customers.vue

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
1616
data: ()=>{
1717
return{
18+
isBest: true,
1819
bestCustomers: [
1920
{username: "William Kamuyo"},
2021
{username: "Karanja Raphael"},

src/components/display-events.vue

Lines changed: 2 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
<template>
2+
<div>
23
<div class="panelDown p3">
34
<div class="panel-heading">Events</div>
45
<div class="panel-body" v-bind:style="{ color: activeColor, fontSize: fontSize + 'px' }">
@@ -7,6 +8,7 @@
78
</ul>
89
</div>
910
</div>
11+
</div>
1012
</template>
1113

1214
<script>
@@ -15,7 +17,6 @@
1517
1618
data : ()=>{
1719
return{
18-
1920
eventsCyt: [
2021
{name: "Marathon"},
2122
{name: "Cake Cutting"},
@@ -33,22 +34,6 @@
3334
box-sizing: border-box;
3435
}
3536
36-
#app {
37-
font-family: 'Avenir', Helvetica, Arial, sans-serif;
38-
-webkit-font-smoothing: antialiased;
39-
-moz-osx-font-smoothing: grayscale;
40-
text-align: center;
41-
color: #2c3e50;
42-
margin-top: 60px;
43-
}
44-
45-
.panel {
46-
width: 900px;
47-
/*height: 200px;*/
48-
background: transparent;
49-
border: 1px solid black;
50-
margin: 0 auto;
51-
}
5237
5338
.panelDown {
5439
float: left;
@@ -68,10 +53,6 @@
6853
background: yellow;
6954
}
7055
71-
.del {
72-
background: red;
73-
}
74-
7556
.p2 ul li {
7657
text-decoration: none;
7758
list-style: none;
@@ -88,12 +69,6 @@
8869
text-align: left;
8970
}
9071
91-
.row:after {
92-
content: "";
93-
display: table;
94-
clear: both;
95-
}
96-
9772
.panel-heading {
9873
background: #9dd85c;
9974
height: 30px;
@@ -120,13 +95,4 @@
12095
width: 200px;
12196
}
12297
123-
.button {
124-
width: 200px;
125-
height: 20px;
126-
margin: 10px auto;
127-
}
128-
129-
.hidden {
130-
visibility: hidden;
131-
}
13298
</style>

src/components/display-order.vue

Lines changed: 28 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
<template>
22
<div>
33
<h4>Current Order List</h4>
4+
{{currentOrder}}
45
<table>
56
<thead>
67
<tr>
@@ -12,7 +13,7 @@
1213
</thead>
1314
<tbody>
1415

15-
<tr v-bind:key="order.userName" v-for="(order, index) in currentOrder">
16+
<tr v-bind:key="order.userName" v-for="(order, index) in foodOrders">
1617
<td>{{order.userName}}</td>
1718
<td>{{order.foodOrder}}</td>
1819
<td>{{order.actionStatus}}</td>
@@ -23,14 +24,37 @@
2324
</tr>
2425
</tbody>
2526
</table>
27+
<hr>
2628
</div>
2729
</template>
2830

2931
<script>
3032
export default {
31-
data: ()=>{
32-
33-
}
33+
props: ['currentOrder'],
34+
data: ()=>{
35+
return{
36+
actionStatus: 'Waiting',
37+
order: {},
38+
foodOrders: [
39+
{userName: 'Michael Mukolwe', foodOrder: 'Fish Ugali', actionStatus: 'Waiting'},
40+
],
41+
}
42+
},
43+
//methods....nb: must be in methods container
44+
methods: {
45+
addToDoOrder() {
46+
this.id = Math.random();
47+
this.foodOrders.push(this.order);
48+
this.order = {};
49+
// console.log(this.foodOrders);
50+
},
51+
52+
delToDoTask(index) {
53+
54+
this.foodOrders.splice(index, 1);
55+
// this.foodOrders = this.foodOrders.filter(order => order.id !== taskObj.id);
56+
},
57+
}
3458
3559
}
3660
</script>

src/components/make-order.vue

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,19 +9,21 @@
99
<br/>
1010
<input class="hidden" type="text" value="Waiting" v-model="actionStatus"/>
1111
</form>
12-
<display-current-order :currentOrder="order"></display-current-order>
12+
<display-order :currentOrder="order"></display-order>
13+
<display-current-order :userName="order.userName" :foodOrder="order.foodOrder" :currentStatus="actionStatus"></display-current-order>
1314
</div>
1415
</template>
1516

1617
<script>
1718
import Vue from 'vue';
1819
19-
Vue.component('display-current-order', require('../components/display-order.vue').default);
20+
Vue.component('display-order', require('./display-order').default);
21+
Vue.component('display-current-order', require('./display-current-order').default);
22+
2023
export default {
2124
name: "make-order",
2225
data() {
2326
return {
24-
isBest: false,
2527
actionStatus: 'Waiting',
2628
order: {},
2729
foodOrders: [

0 commit comments

Comments
 (0)