Created
July 17, 2017 11:21
-
-
Save boonyasukd/759fbfa758c6ab2da1fa5ef1db7b54ca to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<template> | |
<div class="container"> | |
<div class="row"> | |
<div class="col-xs-12"> | |
<br> | |
<button class="btn btn-primary" @click="selected = 'app-blue'">Load Blue Template</button> | |
<button class="btn btn-success" @click="selected = 'app-green'">Load Green Template</button> | |
<button class="btn btn-danger" @click="selected = 'app-red'">Load Red Template</button> | |
<hr> | |
<component :is="selected"> | |
<span>Hey yo!</span> | |
</component> | |
</div> | |
</div> | |
</div> | |
</template> | |
<script> | |
import Blue from './components/Blue.vue'; | |
import Green from './components/Green.vue'; | |
import Red from './components/Red.vue'; | |
export default { | |
data() { | |
return { | |
selected: null, | |
}; | |
}, | |
components: { | |
appBlue: Blue, | |
appGreen: Green, | |
appRed: Red | |
} | |
} | |
</script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<template> | |
<div> | |
<slot></slot> | |
</div> | |
</template> | |
<script> | |
</script> | |
<style scoped> | |
div { | |
border: 1px solid blue; | |
background-color: lightblue; | |
padding: 30px; | |
margin: 20px auto; | |
text-align: center | |
} | |
</style> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<template> | |
<div> | |
<slot></slot> | |
</div> | |
</template> | |
<script> | |
</script> | |
<style scoped> | |
div { | |
border: 1px solid green; | |
background-color: lightgreen; | |
padding: 30px; | |
margin: 20px auto; | |
text-align: center | |
} | |
</style> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<template> | |
<div> | |
<slot></slot> | |
</div> | |
</template> | |
<script> | |
</script> | |
<style scoped> | |
div { | |
border: 1px solid red; | |
background-color: lightcoral; | |
padding: 30px; | |
margin: 20px auto; | |
text-align: center | |
} | |
</style> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment