This repository has been archived on 2021-09-06. You can view files and clone it, but cannot push or open issues or pull requests.
vuejs_course/2021-03-17_http-01-starting.../src/components/survey/SurveyResult.vue

49 lines
645 B
Vue

<template>
<li>
<p>
<span class="highlight">{{ name }}</span> rated the learning experience
<span :class="ratingClass">{{ rating }}</span>.
</p>
</li>
</template>
<script>
export default {
props: ['name', 'rating'],
computed: {
ratingClass() {
return 'highlight rating--' + this.rating;
},
},
};
</script>
<style scoped>
li {
margin: 1rem 0;
border: 1px solid #ccc;
padding: 1rem;
}
h3,
p {
font-size: 1rem;
margin: 0.5rem 0;
}
.highlight {
font-weight: bold;
}
.rating--poor {
color: #b80056;
}
.rating--average {
color: #330075;
}
.rating--great {
color: #008327;
}
</style>