index.vue 2.0KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  1. <template>
  2. <div>
  3. <vue-ueditor-wrap v-model="contents" :config="myConfig" ></vue-ueditor-wrap>
  4. </div>
  5. </template>
  6. <script>
  7. import VueUeditorWrap from 'vue-ueditor-wrap';
  8. export default {
  9. name: 'ueditor',
  10. components:{
  11. VueUeditorWrap
  12. },
  13. props: {
  14. content: '',
  15. // new_content:'',
  16. },
  17. data () {
  18. return {
  19. contents: this.content,
  20. myConfig: {
  21. autoHeightEnabled: false, // 编辑器不自动被内容撑高
  22. initialFrameHeight: 540, // 初始容器高度
  23. initialFrameWidth: '100%', // 初始容器宽度
  24. UEDITOR_HOME_URL: '/static/ueditor/',
  25. // 上传文件接口(这个地址是我为了方便各位体验文件上传功能搭建的临时接口,请勿在生产环境使用!!!)
  26. serverUrl: ``,
  27. toolbars: [
  28. [
  29. 'undo', //撤销
  30. 'redo',
  31. 'removeformat',//橡皮擦
  32. 'forecolor',
  33. 'bold', //加粗
  34. 'fontfamily', //字体
  35. 'fontsize', //字号
  36. 'underline', //下划线
  37. 'justifyleft', //居左对齐
  38. 'justifycenter', //居中对齐
  39. 'justifyright', //居右对齐
  40. 'justifyjustify', //两端对齐
  41. 'indent', //首行缩进
  42. 'formatmatch', //格式刷
  43. 'pasteplain',//纯文本粘贴
  44. 'inserttable',
  45. 'deletetable',
  46. 'insertparagraphbeforetable',
  47. 'insertrow',
  48. 'deleterow',
  49. 'insertcol',
  50. 'deletecol',
  51. 'mergecells',
  52. 'mergeright',
  53. 'mergedown',
  54. 'splittocells',
  55. 'splittorows',
  56. 'splittocols',
  57. ]
  58. ]
  59. }
  60. }
  61. },
  62. created(){
  63. console.log('111111',this.new_content,this.contents);
  64. }
  65. }
  66. </script>
  67. <style scoped>
  68. </style>