繁体   English   中英

CKeditor如何与Bower一起使用

[英]CKeditor how to use with Bower

我正在尝试制作一些html RTF编辑器。 我已经从Bower安装了CKeditor,如CKeditor的文档中所示:

{
  "name": "my-project",
  "dependencies": {
    "ckeditor": "4"
  }
}

但是我不知道如何使用它,在文档中有一个示例显示了如何通过普通安装而不是Bower使用它:

<!DOCTYPE html>
<html>
    <head>
        <meta charset="utf-8">
        <title>A Simple Page with CKEditor</title>
        <!-- Make sure the path to CKEditor is correct. -->
        <script src="../ckeditor.js"></script>
    </head>
    <body>
        <form>
            <textarea name="editor1" id="editor1" rows="10" cols="80">
                This is my textarea to be replaced with CKEditor.
            </textarea>
            <script>
                // Replace the <textarea id="editor1"> with a CKEditor
                // instance, using default configuration.
                CKEDITOR.replace( 'editor1' );
            </script>
        </form>
    </body>
</html>

您能否在我的项目中没有此ckeditor.js的情况下帮助我并展示如何使用它?

无论bower.json文件位于何处,您都将拥有一个“ bower_components”文件夹。 深入研究它,找到所需的ckeditor.js文件,然后将html中的路径设置为此路径。

它看起来像这样:

<script src="../bower_components/ckeditor/ckeditor.js"></script>

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM