dangvanthanh / vue-ckeditor2

CKEditor 4 wrapper by Vue.js
https://vue-ckeditor2.surge.sh/
MIT License
171 stars 64 forks source link

Unexpected token #8

Closed jtundag closed 7 years ago

jtundag commented 7 years ago

image

dangvanthanh commented 7 years ago

The issues when maybe you use webpack templates. You can upgrade new version of vue-ckeditor2 for fixed bug.

jtundag commented 7 years ago

I encountered another issue: image

I'm using laravel, here's my package.json :

{
  "private": true,
  "scripts": {
    "prod": "gulp --production",
    "dev": "gulp watch"
  },
  "devDependencies": {
    "babel-helper-vue-jsx-merge-props": "^2.0.2",
    "babel-plugin-syntax-jsx": "^6.18.0",
    "babel-plugin-transform-vue-jsx": "^3.1.2",
    "bootstrap-sass": "^3.3.7",
    "css-loader": "^0.26.1",
    "element-ui": "^1.0.8",
    "gulp": "^3.9.1",
    "jquery": "^3.1.0",
    "laravel-elixir": "^6.0.0-9",
    "laravel-elixir-vue-2": "^0.2.0",
    "laravel-elixir-webpack-official": "^1.0.2",
    "lodash": "^4.16.2",
    "nprogress": "^0.2.0",
    "style-loader": "^0.13.1",
    "tinymce": "^4.5.1",
    "toastr": "^2.1.2",
    "vue": "^2.0.1",
    "vue-ckeditor2": "^1.0.2",
    "vue-quill-editor": "^1.1.0",
    "vue-resource": "^1.0.3",
    "vue-style-loader": "^1.0.0",
    "vuedraggable": "^2.7.0-rc0"
},
  "dependencies": {
    "element-ui": "^1.0.1",
    "laravel-echo": "^1.1.3",
    "nprogress": "^0.2.0",
    "vue-color": "^2.0.5",
    "vue-router": "^2.0.1",
    "vuejs-datatable": "^0.6.0"
  }
}

and here's my gulpfile.js :

const elixir = require('laravel-elixir');

require('laravel-elixir-vue-2');

elixir(function(mix) {
    mix.webpack('main.js');
    mix.webpack('admin/main.js', 'assets\\dist\\js\\admin\\main.js');
    mix.sass([
        './node_modules/element-ui/lib/theme-default/index.css',
        './assets/css/style.css'
        ], './assets/dist/css/main.css');
    mix.sass([
        './node_modules/element-ui/lib/theme-default/index.css',
        'app.scss'
    ]);
});
dangvanthanh commented 7 years ago

You need include ckeditor.js library in the browser such as page you need display before using vue-ckeditor.

Example index.html

<script src="//cdn.ckeditor.com/4.6.2/standard/ckeditor.js"></script>

or

<script src="/path/ckeditor.js"></script>
jtundag commented 7 years ago

Thanks! 👍