in src/main.js [21:60]
export function init(el, option) {
const i18n = new VueI18n({
locale: option.locale,
fallbackLocale: 'en',
messages
});
store.cdnRoot = option.cdnRoot;
store.version = option.version;
store.locale = option.locale || 'en';
if (typeof el === 'string') {
el = document.querySelector(el);
}
if (!el) {
throw new Error("Can't find el.");
}
const container = document.createElement('div');
el.appendChild(container);
const page = option.page;
if (page && page !== 'explore') {
const v4Link = document.getElementById('v4-link');
v4Link && v4Link.remove();
}
new Vue({
i18n,
el: container,
render: (h) => {
return h(
{
editor: EditorPage,
explore: ExplorePage,
view: ViewPage
}[page] || ExplorePage
);
}
});
}