Skip to content

Instantly share code, notes, and snippets.

@sparrow
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.
<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