Advertisement
Guest User

Untitled

a guest
Aug 23rd, 2017
58
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.11 KB | None | 0 0
  1. <template>
  2. <div class="col-md-12 contain nopadding">
  3. <note-sidebar :notes="notes" @noteCreated="noteSelected"></note-sidebar>
  4. <note-editor :note="activeNote"/>
  5. </div>
  6.  
  7. </template>
  8. <script>
  9. import NoteEditor from './NoteEditor.vue';
  10. import NoteSidebar from './NoteSidebar';
  11.  
  12. import _ from 'lodash';
  13.  
  14.  
  15. export default {
  16. name: 'note-app',
  17. components:{
  18. NoteEditor,
  19. NoteSidebar
  20. },
  21. // computed: {
  22. // activeNote:_.first(this.notes)
  23. // },
  24. data: () => ({
  25. notes:[
  26. {
  27. 'title':'The base',
  28. 'content':'base Stuffs'
  29. },
  30. {
  31. 'title':'The House',
  32. 'content':'base Stuffs'
  33. },
  34. {
  35. 'title':'The Action',
  36. 'content':'base Stuffs'
  37. }
  38. ],
  39. activeNote:_.first([
  40. {
  41. 'title':'The base',
  42. 'content':'base Stuffs'
  43. },
  44. {
  45. 'title':'The House',
  46. 'content':'base Stuffs'
  47. },
  48. {
  49. 'title':'The Action',
  50. 'content':'base Stuffs'
  51. }
  52. ])
  53. }),
  54.  
  55. methods:{
  56. noteSelected: function(value){
  57. this.activeNote = value;
  58. }
  59. },
  60.  
  61. created() {
  62. //do something after creating vue instance
  63. // this.notes =
  64.  
  65. }
  66. }
  67. </script>
  68. <style lang="scss" scoped>
  69. </style>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement