[Vuejs]-How to 'import' objects without babel (using CDN)

0👍

You needn’t import at all, you can use the global namespace:

window.survey = new Survey.Model(json);

survey
    .onComplete
    .add(function (result) {
        document
            .querySelector('#surveyResult')
            .textContent = "Result JSON:\n" + JSON.stringify(result.data, null, 3);
    });

var app = new Vue({
    el: '#surveyElement',
    data: {
        survey: survey
    }
});

Here is the working sample – https://plnkr.co/edit/kBZXGBLPJLJF5Br9

Leave a comment