Skip to content

Instantly share code, notes, and snippets.

@sparrow
Created March 6, 2018 08:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sparrow/f9be4f12279fb9738a179f3e3576924d to your computer and use it in GitHub Desktop.
Save sparrow/f9be4f12279fb9738a179f3e3576924d to your computer and use it in GitHub Desktop.
This is a JavaScript code snippet that we used for our blog post https://rubygarage.org/blog/things-vue-takes-from-react-and-angular at RubyGarage. This is an example of animation implementation in Vue.
<template>
<div>
<div class='item'>
<div class='middle aligned content'>
<div class='ui fitted checkbox'>
<input @click='removeTask(task)' type='checkbox'>
<label></label>
</div>
<span class='task-text'>{{task}}</span>
</div>
</div>
<div class='ui divider'></div>
</div>
</template>
<script>
export default {
props: ['task', 'removeTask']
}
</script>
<style>
.item {
padding: 5px 0;
line-height: 30px;
}
.task-text {
vertical-align: middle;
margin-left: 5px;
}
</style>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment