if (Config.modulename == 'admin' && Config.controllername == 'index' && Config.actionname == 'index') { require.config({ paths: { 'text': "../addons/shopro/libs/require-text", 'SaChat': '../addons/shopro/chat/index', }, shim: {}, }); require(['jquery', 'text!../addons/shopro/chat/index.html', 'SaChat'], function ($, SaChatTemplate, SaChat) { Fast.api.ajax({ url: 'shopro/chat/index/init', loading: false, type: 'GET' }, function (ret, res) { console.log(res, 'res') $("body").append(`
`); $("#SaChatTemplateContainer").append(SaChatTemplate); const { createApp } = Vue const app = createApp({}) app.use(ElementPlus) for (const [key, component] of Object.entries(ElementPlusIconsVue)) { app.component(key, component) } app.component('sa-chat', SaChat) app.mount(`#SaChatWrap`) return false; }, function (ret, res) { if (res.msg == '') { return false; } }) }); }