Javascript-форум (https://javascript.ru/forum/)
-   Библиотеки/Тулкиты/Фреймворки (https://javascript.ru/forum/library-toolkit-framework/)
-   -   Using ES6 modules (https://javascript.ru/forum/library-toolkit-framework/77753-using-es6-modules.html)

Ким чен ин 16.06.2019 00:14

Using ES6 modules
 
Подскажите, не пойму,
как понимать вот эту инструкцию?

import Vue from 'vue';
import CKEditor from '@ckeditor/ckeditor5-vue';

Vue.use( CKEditor );

Instead of calling Vue.use(), you can always use the component locally.
<template>
    <div id="app">
        <ckeditor :editor="editor" ... ></ckeditor>
    </div>
</template>

<script>
    export default {
        name: 'app',
        components: {
            // Use the <ckeditor> component in this view.
            ckeditor: CKEditor.component
        },
        data() {
            return {
                editor: ClassicEditor,

                // ...
            };
        }
    }
</script>

https://ckeditor.com/docs/ckeditor5/...ponent-locally

никак не могу добится что бы работало локально
делаю импорт
import CKEditor from '@ckeditor/ckeditor5-vue';
дальше согласно доке объявляю компонент
components: {
            // Use the <ckeditor> component in this view.
            ckeditor: CKEditor.component
        },

естественно он не находит модуль ....

Aetae 16.06.2019 22:25

Раз не находит значит его наверное нет?)
npm i @ckeditor/ckeditor5-vue или yarn add @ckeditor/ckeditor5-vue

Ким чен ин 16.06.2019 23:01

разобрался, чота тупил тупил, потом разобрался
import CKEditor from '@ckeditor/ckeditor5-vue';
 import ClassicEditor from '@ckeditor/ckeditor5-build-classic';
//

        components: {
            ckeditor: CKEditor.component,
        },


Часовой пояс GMT +3, время: 11:02.