[Vuejs]-Same component with different background-color

2👍

Pass color also as a prop:

 <ProjectCard
      title="Projekt 02"
      description="Lorem Ipsum"
      color= "#000F"
    />
<ProjectCard
      title="Projekt 02"
      description="Lorem Ipsum"
      color= "#00FF00"
    />

and in script:

<script>
export default {
  name: 'ProjectCard',
  props: {
    title: String,
    description: String,
    color:String
  },
  data: function() {
    return {
      color: "#000"
    }
  }
}
</script>
👤Neha

Leave a comment