xm-select/src/main.js
2019-12-02 15:10:58 +08:00

30 lines
723 B
JavaScript

import '@/common/expand'
import '@/style/index.less'
import '@/style/iconfont.less'
import { default as xmSelect, datas } from './index.js';
const moduleName = 'xmSelect';
/**
* 监听全页面点击关闭事件
*/
window.addEventListener('click', () => {
Object.keys(datas).forEach(key => {
let item = datas[key]
item && item.closed && item.closed()
})
})
if ((typeof exports === 'undefined' ? 'undefined' : _typeof(exports)) === 'object') {
module.exports = xmSelect;
} else if (typeof define === 'function' && define.amd) {
define(xmSelect);
} else if (window.layui && layui.define) {
layui.define(function(exports) {
exports(moduleName, xmSelect);
});
}
window[moduleName] = xmSelect;