调整使用dom渲染get等方法的错误; 调整宽度过窄时分页的样式
This commit is contained in:
@@ -2,7 +2,7 @@
|
||||
* 选中dom元素
|
||||
*/
|
||||
export function selector(el) {
|
||||
return document.querySelector(el);
|
||||
return el.nodeType ? el : document.querySelector(el);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -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 ;
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user