add.vue 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. <script>
  2. // import editor from "@ckeditor/ckeditor5-build-classic";
  3. // import "@ckeditor/ckeditor5-build-classic/build/translations/ja.js";
  4. // import ClassicEditor from "@ckeditor/ckeditor5-build-classic";
  5. // Vue.use( CKEditor );
  6. import RoundedTitle from "../../../components/public/roundedTitle.vue";
  7. let ClassicEditor;
  8. if (process.client) {
  9. ClassicEditor = require('@ckeditor/ckeditor5-build-classic')
  10. }
  11. export default {
  12. name: "add",
  13. components: {
  14. RoundedTitle
  15. // Use the <ckeditor> component in this view.
  16. },
  17. data(){
  18. return {
  19. editor: ClassicEditor,
  20. editorData: '<p>文章内容</p>',
  21. editorConfig: {
  22. language: "zh-cn"
  23. }
  24. }
  25. }
  26. }
  27. </script>
  28. <template>
  29. <div class="w-full p-2">
  30. <rounded-title class="text-xl">
  31. <span>新增文章</span>
  32. <a href="/manger/news"
  33. class="px-10 h-full ml-5 rounded bg-blue-400 text-white cursor-pointer
  34. hover:text-orange-500 ">文章中心</a>
  35. </rounded-title>
  36. <div class="page-content-box w-full mt-2 p-0.5 rounded bg-white">
  37. <ckeditor :editor="editor" v-model="editorData" :config="editorConfig"></ckeditor>
  38. </div>
  39. </div>
  40. </template>
  41. <style scoped>
  42. .page-content-box{
  43. min-height: 500px;
  44. }
  45. </style>