Skip to content

Loaded scripts are available only with delay #95

@fairking

Description

@fairking

Only after some certain delay scrips ara available for use in mounted method.
E.g.

head: {
			style: [
				{ type: 'text/css', src: 'stimulsoft/stimulsoft.designer.office2013.whiteblue.css' },
				{ type: 'text/css', src: 'stimulsoft/stimulsoft.viewer.office2013.whiteblue.css' }
			],
			script: [
				{ type: 'text/javascript', src: 'stimulsoft/stimulsoft.reports.js' },
				{ type: 'text/javascript', src: 'stimulsoft/stimulsoft.viewer.js' },
				{ type: 'text/javascript', src: 'stimulsoft/stimulsoft.designer.js' }
			]
		},
mounted() {
    // Version 1 (Not Working, Error: Cannot read property 'Designer' of undefined")
    this.$on('okHead', function () {
        this.stiInit();
    });
    // Or Version 2 (Working)
    this.$on('okHead', function () {
        setTimeout(this.stiInit, 1000);
    });
},
methods: {
    stiInit() {
        var options = new window.Stimulsoft.Designer.StiDesignerOptions(); 
        var designer = new window.Stimulsoft.Designer.StiDesigner(options, "StiDesigner", false);
    }
}

Is there any way to solve that problem without using the delay?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions