Skip to content

Commit e6d2eaf

Browse files
committed
store the selected quarter
1 parent ee101ee commit e6d2eaf

File tree

1 file changed

+51
-45
lines changed

1 file changed

+51
-45
lines changed

src/components/HelloWorld.vue

Lines changed: 51 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,17 @@
11
<template>
2-
<div class="hello">
2+
<!-- <div class="hello"> -->
3+
<div class="focus">
34
<h1>{{ msg }}</h1>
45

56
<el-row>
67

78
Select quarter:
8-
<el-button>Fall</el-button>
9-
<el-button>Winter</el-button>
10-
<el-button>Spring</el-button>
11-
<el-button>Summer</el-button>
12-
9+
<el-button class='focus' v-on:click="setFall">Fall</el-button>
10+
<el-button v-on:click="setWinter">Winter</el-button>
11+
<el-button v-on:click="setSpring">Spring</el-button>
12+
<el-button v-on:click="setSummer">Summer</el-button>
1313
</el-row>
14+
<p>Selected quarter: {{ quarter }}</p>
1415

1516
<p>
1617
Select department:
@@ -28,57 +29,56 @@
2829
</el-option-group>
2930
</el-select>
3031
</p>
31-
32-
32+
<p>Selected course: {{ course }}</p>
3333
<el-button type="primary" icon="el-icon-search">Search</el-button>
34-
35-
36-
<!--
37-
<h3>Installed CLI Plugins</h3>
38-
<ul>
39-
<li><a href="https://github.com/vuejs/vue-cli/tree/dev/packages/%40vue/cli-plugin-babel" target="_blank" rel="noopener">babel</a></li>
40-
</ul>
41-
<h3>Essential Links</h3>
42-
<ul>
43-
<li><a href="https://vuejs.org" target="_blank" rel="noopener">Core Docs</a></li>
44-
45-
</ul>
46-
<h3>Ecosystem</h3>
47-
<ul>
48-
<li><a href="https://router.vuejs.org" target="_blank" rel="noopener">vue-router</a></li>
49-
50-
</ul>
51-
-->
34+
5235
</div>
5336
</template>
5437

5538
<script>
39+
5640
export default {
5741
name: 'HelloWorld',
5842
props: {
5943
msg: String
6044
},
45+
methods:{
46+
setFall() {
47+
this.quarter = 'Fall'
48+
},
49+
setWinter() {
50+
this.quarter = 'Winter'
51+
},
52+
setSpring() {
53+
this.quarter = 'Spring'
54+
},
55+
setSummer() {
56+
this.quarter = 'Summer'
57+
}
58+
},
6159
data() {
6260
return {
63-
quarterOptions:
64-
[
65-
{
66-
valueQ: 'option1',
67-
labelQ: 'Fall'
68-
},
69-
{
70-
valueQ: 'option2',
71-
labelQ: 'Winter'
72-
},
73-
{
74-
valueQ: 'option3',
75-
labelQ: 'Spring'
76-
},
77-
{
78-
valueQ: 'option4',
79-
labelQ: 'Summer'
80-
}
81-
],
61+
quarter: '',
62+
course: '',
63+
// quarterOptions:
64+
// [
65+
// {
66+
// valueQ: 'option1',
67+
// labelQ: 'Fall'
68+
// },
69+
// {
70+
// valueQ: 'option2',
71+
// labelQ: 'Winter'
72+
// },
73+
// {
74+
// valueQ: 'option3',
75+
// labelQ: 'Spring'
76+
// },
77+
// {
78+
// valueQ: 'option4',
79+
// labelQ: 'Summer'
80+
// }
81+
// ],
8282
departmentOptions:
8383
[
8484
{
@@ -545,4 +545,10 @@ a {
545545
line-height: 100px;
546546
}
547547
548+
.focus:focus {
549+
/* color: darkcyan; */
550+
color: red;
551+
}
552+
553+
548554
</style>

0 commit comments

Comments
 (0)