1

我在 laravel 中使用鹅毛笔羊皮纸,但我无法读取属性'attributor'

我的代码:

let Align = new Parchment.Attributor.Class('align', 'blot-align');
Parchment.register(Align)
let node = document.createElement('div');
Align.add(node, 'right');

参考墨水https://github.com/quilljs/parchment#class-attributor

我面临的错误:

 Uncaught TypeError: Cannot read property 'Attributor' of undefined

详细错误

Uncaught TypeError: Cannot read property 'Attributor' of undefined
    at Module../resources/js/core/editor/wygsiwyg.js (app.js:234074)
    at __webpack_require__ (app.js:20)
    at Module../node_modules/babel-loader/lib/index.js?!./node_modules/vue-loader/lib/index.js?!./resources/js/index.vue?vue&type=script&lang=js& (app.js:34862)
    at __webpack_require__ (app.js:20)
    at Module../resources/js/index.vue?vue&type=script&lang=js& (app.js:235398)
    at __webpack_require__ (app.js:20)
    at Module../resources/js/index.vue (app.js:235360)
    at __webpack_require__ (app.js:20)
    at Module../resources/js/app.js (app.js:228035)
    at __webpack_require__ (app.js:20)

我也试过 webpack:

mix.js('resources/js/app.js', 'public/js')
    .sass('resources/sass/app.scss', 'public/css')
    .version();
mix.webpackConfig({
    resolve: {
        alias: {
            '@': path.resolve(__dirname, '../node_modules/parchment/src/parchment.js')
        }
    },

   node: { fs: 'empty' }})
4

0 回答 0