carstenschaefer / DrawerJs

A customizable WYSIWYG HTML canvas editor.
https://www.drawerjs.com
MIT License
556 stars 113 forks source link

ReferenceError: DrawerJs is not defined #39

Closed naveenkumarmark closed 5 years ago

naveenkumarmark commented 5 years ago

Hi All, I am new to this tool. I wish to add it in my vue web page. I tried the following to implement it but it throws issue like this. ReferenceError: DrawerJs is not defined How to fix this?

import drawerLocalization from './DrawerLocalization' import drawerJsConfig from './redactorConfig' import DrawerJs from './Drawer'

var drawer = new DrawerJs.Drawer(null, { texts: drawerLocalization, plugins: drawerJsConfig, defaultImageUrl: '/images/drawer.jpg', defaultActivePlugin : { name : 'Pencil', mode : 'lastUsed'}, }, 600, 600); $('#canvas-editor').append(drawer.getHtml()); drawer.onInsert(); })

naveenkumarmark commented 5 years ago

I solved this issue by downloading all the needed files and saved them to my local. I loaded those css and js files from my local system.