TargetStudents.vue 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. <template>
  2. <div class="card manage-card">
  3. <header class="card-header card-section">
  4. <p class="card-header-title">Target your Students</p>
  5. </header>
  6. <div class="card-content card-section">
  7. <form>
  8. <multi-line-text-input
  9. @addClicked="addLine('wsl')"
  10. @removeClicked="removeLine($event, 'wsl')"
  11. :lines="course.wsl"
  12. label="What will students learn"
  13. />
  14. <multi-line-text-input
  15. @addClicked="addLine('requirements')"
  16. @removeClicked="removeLine($event, 'requirements')"
  17. :lines="course.requirements"
  18. label="What are the requirements"
  19. />
  20. </form>
  21. </div>
  22. </div>
  23. </template>
  24. <script>
  25. import MultiLineTextInput from "~/components/form/MultiLineTextInput";
  26. export default {
  27. components : {
  28. MultiLineTextInput
  29. },
  30. props :{
  31. course: {
  32. type: Object,
  33. required: true
  34. }
  35. },
  36. methods: {
  37. addLine(field) {
  38. // Dispatch action to add line
  39. console.log('Adding line for: ', field)
  40. this.$store.commit('instructor/course/addLine', field)
  41. },
  42. removeLine(index, field) {
  43. // Dispatch action to remove line line
  44. console.log('Removing line of index:', index)
  45. console.log('Removing line for:', field)
  46. this.$store.commit('instructor/course/removeLine', {field, index})
  47. }
  48. }
  49. }
  50. </script>