Last active
June 6, 2017 12:01
This a JavaScript code snippet that we used for our blog post https://rubygarage.org/blog/vuejs-vs-react-battle at RubyGarage. This code shows a typical VueJS component.
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="root"> | |
<div> | |
<input id="input" v-model="text" type="text" /> | |
<p> | |
Two-way bound value is {{ text }} | |
</p> | |
</div> | |
<some-component></some-component> | |
</div> | |
</template> | |
<script> | |
import SomeComponent from './Cell.vue' | |
export default { | |
components: { SomeComponent }, | |
data () { | |
return { | |
text: 'New Vue App', | |
} | |
} | |
} | |
</script> | |
<style scoped> | |
.root { | |
background-color: #34495e; | |
color: #fff; | |
width: 100%; | |
} | |
</style> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment