Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <div id="app">
- <div v-for="s in status">
- <div v-if="s == 'YES'" class="yes">{{ s }}</div>
- <div v-else-if="s == 'NO'" class="no">{{ s }}</div>
- <div v-else class="empty">{{ s }}</div>
- </div>
- </div>
- new Vue({
- el: "#app",
- data: {
- status: [ "YES", "NO", "null" ]
- },
- methods: {
- }
- })
- body {
- background: #20262E;
- padding: 20px;
- font-family: Helvetica;
- }
- #app {
- background: #fff;
- border-radius: 4px;
- padding: 20px;
- transition: all 0.2s;
- }
- .yes {
- background-Color: green
- }
- .no {
- background-Color: red
- }
- .empty {
- background-Color: grey
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement