INNER CODE UNIT · JavaScript
_buildApp
ChatFAQ/ChatFAQ · widget/components/index.js:7
function _buildApp(props) {
const app = createApp({ render: () => expose = h(Widget, props) })
.use(_createPinia())
.use(_createI18n());
app.use(createHead());
return app;
}
class ChatfaqWidget {
constructor(attrs) {
if (typeof attrs.element == "string")
attrs.element = document.querySelector(attrs.element)
this.element = attrs.element;
const props = { ...this.element.dataset, ...attrs }
this.app = _buildApp(props);
}