editor-modal-editorselect.vue 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108
  1. <template lang='pug'>
  2. v-dialog(v-model='isShown', persistent, max-width='700')
  3. v-card.radius-7(color='blue darken-3', dark)
  4. v-card-text.text-center.py-4
  5. .subtitle-1.white--text {{$t('editor:select.title')}}
  6. v-container(grid-list-lg, fluid)
  7. v-layout(row, wrap, justify-center)
  8. v-flex(xs4)
  9. v-card.radius-7.grey(
  10. hover
  11. light
  12. ripple
  13. disabled
  14. )
  15. v-card-text.text-center(@click='selectEditor("api")')
  16. img(src='/svg/icon-rest-api.svg', alt='API', style='width: 36px;')
  17. .body-2.mt-2.grey--text.text--darken-2 API Docs
  18. .caption.grey--text.text--darken-1 REST / GraphQL
  19. v-flex(xs4)
  20. v-card.radius-7.grey(
  21. hover
  22. light
  23. ripple
  24. disabled
  25. )
  26. v-card-text.text-center(@click='selectEditor("code")')
  27. img(src='/svg/icon-source-code.svg', alt='Code', style='width: 36px;')
  28. .body-2.mt-2.grey--text.text--darken-2 Code
  29. .caption.grey--text.text--darken-1 Raw HTML
  30. v-flex(xs4)
  31. v-card.radius-7(
  32. hover
  33. light
  34. ripple
  35. )
  36. v-card-text.text-center(@click='selectEditor("markdown")')
  37. img(src='/svg/icon-markdown.svg', alt='Markdown', style='width: 36px;')
  38. .primary--text.body-2.mt-2 Markdown
  39. .caption.grey--text Default
  40. v-flex(xs4)
  41. v-card.radius-7.grey(
  42. hover
  43. light
  44. ripple
  45. disabled
  46. )
  47. v-card-text.text-center(@click='selectEditor("tabular")')
  48. img(src='/svg/icon-table.svg', alt='Tabular', style='width: 36px;')
  49. .body-2.grey--text.mt-2.text--darken-2 Tabular
  50. .caption.grey--text.text--darken-1 Excel-like
  51. v-flex(xs4)
  52. v-card.radius-7.grey(
  53. hover
  54. light
  55. ripple
  56. disabled
  57. )
  58. v-card-text.text-center(@click='selectEditor("wysiwyg")')
  59. img(src='/svg/icon-open-in-browser.svg', alt='Visual Builder', style='width: 36px;')
  60. .body-2.mt-2.grey--text.text--darken-2 Visual Builder
  61. .caption.grey--text.text--darken-1 Drag-n-drop
  62. v-flex(xs4)
  63. v-card.radius-7.grey(
  64. hover
  65. light
  66. ripple
  67. disabled
  68. )
  69. v-card-text.text-center(@click='selectEditor("wikitext")')
  70. img(src='/svg/icon-news.svg', alt='WikiText', style='width: 36px;')
  71. .body-2.grey--text.mt-2.text--darken-2 WikiText
  72. .caption.grey--text.text--darken-1 MediaWiki Format
  73. .caption.blue--text.text--lighten-2 {{$t('editor:select.cannotChange')}}
  74. </template>
  75. <script>
  76. import _ from 'lodash'
  77. import { sync } from 'vuex-pathify'
  78. export default {
  79. props: {
  80. value: {
  81. type: Boolean,
  82. default: false
  83. }
  84. },
  85. data() {
  86. return { }
  87. },
  88. computed: {
  89. isShown: {
  90. get() { return this.value },
  91. set(val) { this.$emit('input', val) }
  92. },
  93. currentEditor: sync('editor/editor')
  94. },
  95. methods: {
  96. selectEditor(name) {
  97. this.currentEditor = `editor${_.startCase(name)}`
  98. this.isShown = false
  99. }
  100. }
  101. }
  102. </script>
  103. <style lang='scss'>
  104. </style>