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