Disable calling init if already initialized

This commit is contained in:
redhoodsu
2019-07-15 16:06:29 +08:00
parent 576eb17fda
commit 2a44aede84
2 changed files with 4 additions and 0 deletions

View File

@@ -31,6 +31,8 @@ import {
module.exports = {
init({ container, tool, autoScale = true, useShadowDom = true } = {}) {
if (this._isInit) return
this._isInit = true
this._scale = 1
@@ -104,6 +106,7 @@ module.exports = {
this._unregisterListener()
this._$el.remove()
evalCss.clear()
this._isInit = false
},
scale(s) {
if (isNum(s)) {