vue中使用ckeditor


1.第一步首先去ckeditor官網去下載editor文件,這里以ckeditor4為例

  首先在index.html里引入js代碼

 <script type="text/javascript" src="/static/ckeditor/ckeditor.js"></script>

2然后在webpack.base.conf.js里編寫

.

3.在需要使用的模塊里引入

<template>
  <div id="video">
video
<textarea id="editor" rows="10" cols="80"></textarea>

  </div>
</template>
<script>
import CKEDITOR from "CKEDITOR"
  export default{
    name:'video',
    mounted() {
      CKEDITOR.replace("editor", {height: "300px", width: "100%", toolbar: "Full"});
      var editor = CKEDITOR.instances.editor2;
    },
  }
</script>

<style>

</style>

然后保存運行你的vue項目,即可查看到

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM