Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
// constructor
import CreateInstance from '@cycjimmy/awesome-js-funcs/designPattern/CreateInstance';
import isMobile from '@cycjimmy/awesome-js-funcs/handheld/isMobile';
import promptMobile from './promptMobile.pug'
import _style from './promptMobile.scss'
// image
import QRCodeImg from '../../../static/images/QRCode.png';
const _createInstance = new CreateInstance(); // 构造函数实例
export default class PromptMobileComponentIns {
constructor() {
if (_createInstance()) {
return _createInstance();
}
this.isMobile = false;
this.wrapper = document.createElement('div');
_createInstance(this);
};
load() {
return new Promise((resolve, reject) => {
if (isMobile()) {
this.isMobile = true;
import _style from './promptOrientation.scss';
import promptOrientation from './promptOrientation.pug';
import CreateInstance from '@cycjimmy/awesome-js-funcs/designPattern/CreateInstance';
import functionToPromise from '@cycjimmy/awesome-js-funcs/typeConversion/functionToPromise';
const _instance = new CreateInstance();
export default class {
constructor() {
if (_instance()) {
return _instance();
}
this.wrapper = document.createElement('div');
this.wrapper.classList.add(_style.wrapper);
_instance(this);
};
load() {
return functionToPromise(() => {
this.wrapper.innerHTML = promptOrientation({
export default (Component) => {
const _instance = new CreateInstance();
return (param = {}) => {
if (_instance()) {
return _instance();
}
const component = new Component(param);
_instance(component);
return component;
};
};