createPlaylist.vue 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  1. <template>
  2. <div class='modal is-active'>
  3. <div class='modal-background'></div>
  4. <div class='modal-card'>
  5. <header class='modal-card-head'>
  6. <p class='modal-card-title'>Create Playlist</p>
  7. <button class='delete' @click='$parent.toggleModal("createPlaylist")'></button>
  8. </header>
  9. <section class='modal-card-body'>
  10. <p class='control is-expanded'>
  11. <input class='input' type='text' placeholder='Playlist ID' v-model='playlist.id'>
  12. </p>
  13. <p class='control is-expanded'>
  14. <input class='input' type='text' placeholder='Playlist Display Name' v-model='playlist.displayName'>
  15. </p>
  16. </section>
  17. <footer class='modal-card-foot'>
  18. <a class='button is-info' @click='createPlaylist()'>Create Playlist</a>
  19. </footer>
  20. </div>
  21. </div>
  22. </template>
  23. <script>
  24. import { Toast } from 'vue-roaster';
  25. export default {
  26. data() {
  27. return {
  28. playlist: {
  29. id: null,
  30. displayName: null
  31. }
  32. }
  33. },
  34. methods: {
  35. createPlaylist: function () {
  36. // socket
  37. this.$parent.toggleModal("createPlaylist");
  38. }
  39. },
  40. ready: function () {
  41. let _this = this;
  42. let socketInterval = setInterval(() => {
  43. if (!!_this.$parent.$parent.socket) {
  44. _this.socket = _this.$parent.$parent.socket;
  45. clearInterval(socketInterval);
  46. }
  47. }, 100);
  48. }
  49. }
  50. </script>
  51. <style type='scss' scoped>
  52. .menu { padding: 0 20px; }
  53. .menu-list li {
  54. display: flex;
  55. justify-content: space-between;
  56. }
  57. .menu-list a:hover { color: #000 !important; }
  58. li a {
  59. display: flex;
  60. align-items: center;
  61. }
  62. .controls {
  63. display: flex;
  64. a {
  65. display: flex;
  66. align-items: center;
  67. }
  68. }
  69. .table {
  70. margin-bottom: 0;
  71. }
  72. h5 { padding: 20px 0; }
  73. </style>