Advertisement
rozman50

VUE quote project - NewQuote.vue

Jul 13th, 2018
156
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.71 KB | None | 0 0
  1. <template>
  2. <div class="row">
  3. <div class="col-sm-8 col-sm-offset-2 col-xs-12 col-md-6 col-md-offset-3 form-group">
  4. <label>Quote</label>
  5. <textarea rows="3" class="form-control" v-model='quote'></textarea>
  6. </div>
  7. <div class="col-sm-8 col-sm-offset-2 col-xs-12 col-md-6 col-md-offset-3 form-group">
  8. <button class='btn btn-primary' @click.prevent='createNew'>Add Quote</button>
  9. </div>
  10. </div>
  11. </template>
  12.  
  13. <script>
  14.  
  15. export default {
  16. data: function() {
  17. return {
  18. quote: ''
  19. };
  20. },
  21. methods: {
  22. createNew() {
  23. this.$emit('quoteAdded', this.quote);
  24. this.quote = '';
  25. }
  26. }
  27. }
  28. </script>
  29.  
  30. <style>
  31.  
  32. </style>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement