Skip to content

Instantly share code, notes, and snippets.

@jason
Last active November 23, 2016 18:03
Show Gist options
  • Save jason/b1a946572f32f41281b9977e3152ca8b to your computer and use it in GitHub Desktop.
Save jason/b1a946572f32f41281b9977e3152ca8b to your computer and use it in GitHub Desktop.
<template>
<div>
<span class="Plan__name">{{ plan.name }}</span>
<span class=Plan__price>{{ plan.price}}/month</span>
</div>
</template>
<script>
export default {
name: 'plan',
props: ['plan']
}
</script>
<!-- Add "scoped" attribute to limit CSS to this component only -->
<style scoped>
h1, h2 {
font-weight: normal;
}
ul {
list-style-type: none;
padding: 0;
}
li {
display: inline-block;
margin: 0 10px;
}
a {
color: #42b983;
}
.Plan__name {
display: inline-block; min-width: 8rem; text-align: left;}
.Plan__price {display: inline-block; min-width: 8rem; text-align: left;}
</style>
<template>
<div>
<div v-for="plan in plans">
<plan :plan="plan"></plan>
</div>
hello
<!-- <pre>{{ plans | json }}</pre> -->
</div>
</template>
<script>
import Plan from '../Plan'
export default {
name: 'plans',
data () {
return {
plans: [
{ name: 'Enterprise', price: 100 },
{ name: 'Pro', price: 50 },
{ name: 'Personal', price: 10 },
{ name: 'Free', price: 0 }
]
}
},
components: {
plan
}
}
</script>
<!-- Add "scoped" attribute to limit CSS to this component only -->
<style scoped>
h1, h2 {
font-weight: normal;
}
ul {
list-style-type: none;
padding: 0;
}
li {
display: inline-block;
margin: 0 10px;
}
a {
color: #42b983;
}
</style>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment