videoTool.vue 2.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697
  1. <template>
  2. <div class="videoTool">
  3. <h3 class="toolTit">视频</h3>
  4. <div class="toolBox">
  5. <div class="itemBox">
  6. <label>视频地址</label>
  7. <el-input v-model="activeComponent.componentContent.videoUrl" maxlength="60" placeholder="请输入内容"></el-input>
  8. </div>
  9. <!-- <div class="itemBox">-->
  10. <!-- <label>文本</label>-->
  11. <!-- <el-input-->
  12. <!-- type="textarea"-->
  13. <!-- :rows="2"-->
  14. <!-- placeholder="请输入内容"-->
  15. <!-- resize="none"-->
  16. <!-- v-model="textInfo">-->
  17. <!-- </el-input>-->
  18. <!-- </div>-->
  19. <div class="itemBox">
  20. <label>标题</label>
  21. <el-input v-model="activeComponent.componentContent.title" maxlength="20" placeholder="请输入内容"></el-input>
  22. </div>
  23. <div class="itemBox">
  24. <label>正文</label>
  25. <quill-editor
  26. v-model="activeComponent.componentContent.mainBody"
  27. ref="myQuillEditor"
  28. :options="editorOption"
  29. @blur="onEditorBlur($event)" @focus="onEditorFocus($event)"
  30. @change="onEditorChange($event)">
  31. </quill-editor>
  32. </div>
  33. </div>
  34. </div>
  35. </template>
  36. <script>
  37. import { quillEditor } from 'vue-quill-editor'
  38. import {toolMixin} from '@@/config/mixin'
  39. export default {
  40. mixins: [toolMixin],
  41. name: 'videoTool',
  42. components: {
  43. quillEditor
  44. },
  45. data () {
  46. return {
  47. editorOption: {
  48. placeholder: '请输入',
  49. modules: {
  50. toolbar: [
  51. ['bold', 'italic', 'link'] // toggled buttons
  52. ]
  53. }
  54. }
  55. }
  56. },
  57. methods: {
  58. onEditorBlur () { // 失去焦点事件
  59. },
  60. onEditorFocus () { // 获得焦点事件
  61. },
  62. onEditorChange () { // 内容改变事件
  63. console.log(this.mainBody)
  64. }
  65. }
  66. }
  67. </script>
  68. <style lang="scss" scoped>
  69. .videoTool {
  70. padding: 20px 20px 0 20px;
  71. h3 {
  72. font-size: 18px;
  73. font-weight: 500;
  74. height: 35px;
  75. line-height: 35px;
  76. color: #333333;
  77. margin-bottom: 20px;
  78. }
  79. .toolBox {
  80. padding-bottom: 10px;
  81. .itemBox {
  82. label {
  83. font-size: 14px;
  84. color: #666666;
  85. height: 40px;
  86. line-height: 40px;
  87. }
  88. margin-bottom: 15px;
  89. }
  90. }
  91. ::v-deep .ql-container {
  92. height: 200px;
  93. }
  94. }
  95. </style>