调整使用dom渲染get等方法的错误; 调整宽度过窄时分页的样式

This commit is contained in:
maplemei
2019-12-03 10:35:11 +08:00
parent b493563677
commit c6a5080161
8 changed files with 12 additions and 8 deletions

View File

@@ -2,7 +2,7 @@
* 选中dom元素
*/
export function selector(el) {
return document.querySelector(el);
return el.nodeType ? el : document.querySelector(el);
}
/**

View File

@@ -28,7 +28,7 @@ class xmOptions {
this.options = deepMerge(this.options, options);
//如果dom不存在, 则不进行渲染事项
let dom = this.options.el.nodeType ? this.options.el : selector(this.options.el);
let dom = selector(this.options.el);
if(!dom){
warn(`没有找到渲染对象: ${options.el}, 请检查`)
return ;

View File

@@ -311,12 +311,16 @@ xm-select{
flex: auto;
justify-content: center;
vertical-align: middle;
padding: 0 15px;
// padding: 0 15px;
margin: 0 -1px 0 0;
background-color: #fff;
color: #333;
font-size: 12px;
border: 1px solid #e2e2e2;
flex-wrap: nowrap;
width: 100%;
overflow: hidden;
min-width: 50px;
}
}