Skip to content

Instantly share code, notes, and snippets.

@andikasputra
Created August 6, 2021 02:41
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save andikasputra/6dcfa8f7c7e947bf1b9717b2397fe6e8 to your computer and use it in GitHub Desktop.
Save andikasputra/6dcfa8f7c7e947bf1b9717b2397fe6e8 to your computer and use it in GitHub Desktop.
php server side rendering
// FeatureItem.vue
<template>
<div v-bind:style="{ color: textColor }" v-on:click="toggleColor">
<h2>{{ feature.name }}</h2>
<p>{{ feature.description }}</p>
</div>
</template>
<script>
import {PropType} from 'vue'
export default {
props: ['feature'],
data() {
return {textColor: 'black'}
},
methods: {
toggleColor() {
if (this.$data.textColor == 'black') {
this.$data.textColor = 'green'
} else {
this.$data.textColor = 'black'
}
}
}
}
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment