Getting Error in mounted hook: “RangeError: Maximum call stack size exceeded” in VUE js

橙三吉。 提交于 2019-12-11 19:08:48

问题


I am new to VUEJS and have little knowledge of state and mutations. I have a state which has a property called OSDViewer. This property of state is not being used anywhere else in app. My state looks like following.

const state = {
    OSDviewer: null,
}

In my mutations i am trying to set this OSDViwer to an openseadragon object in following way.

setupOsdCanvas: (state, payload) => {
        var OSDviewer = new openseadragon.Viewer({
            id: payload,
            showNavigationControl: false,
            showNavigator: true,
            navigatorId: 'navigator',
            maxZoomPixelRatio: 2
        })
        state.OSDviewer = OSDviewer;
        state.OSDviewer.addHandler('canvas-key', e => {
            if (e.originalEvent.code === 'KeyR' || e.originalEvent.code === 'KeyF') {
                e.preventDefaultAction = true
            }
        })
    },

but i am getting following error

vue.runtime.esm.js?2b0e:619 [Vue warn]: Error in mounted hook: "RangeError: Maximum call stack size exceeded"

What can i do to fix this problem and what is causing it ? I would appreciate any help.

来源:https://stackoverflow.com/questions/56883393/getting-error-in-mounted-hook-rangeerror-maximum-call-stack-size-exceeded-in

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!