content.js 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. define({
  2. template: `
  3. <div>
  4. <div class="vue-main-title">
  5. <div class="vue-main-title-left"></div>
  6. <div class="vue-main-title-content">商品描述</div>
  7. </div>
  8. <tinymceee v-model="form.content" v-if="!isShowContent"></tinymceee>
  9. <tinymceee v-model="content" v-if="isShowContent"></tinymceee>
  10. </div>
  11. `,
  12. style: `
  13. .tox-tinymce {
  14. min-height:600px;
  15. }
  16. `,
  17. props: {
  18. form: {
  19. default() {
  20. return {};
  21. },
  22. },
  23. formKey: {
  24. type: String,
  25. },
  26. },
  27. data() {
  28. return {
  29. isShowContent:false,
  30. content:""
  31. };
  32. },
  33. created() {
  34. // console.log(this.form,'商品描述')
  35. if(this.form){
  36. if(this.form === null){
  37. this.isShowContent = true
  38. return
  39. }
  40. this.isShowContent = false
  41. }else{
  42. this.isShowContent = true
  43. }
  44. },
  45. methods: {
  46. extraDate(){
  47. return {
  48. 'extraContent':"商品描述"
  49. }
  50. },
  51. validate() {
  52. if(this.isShowContent){
  53. return {
  54. content:this.content ? this.content : ""
  55. }
  56. }else{
  57. return {
  58. content:this.form.content ? this.form.content : ""
  59. }
  60. }
  61. },
  62. },
  63. });