修复Windows下的样式错误
This commit is contained in:
maplemei 2019-09-23 10:13:26 +08:00
parent 5b84e95638
commit 342217669b
5 changed files with 21 additions and 22 deletions

View File

@ -5,6 +5,8 @@
前身`formSelectes`, 移除了对`jquery`的依赖, 提高渲染速度 前身`formSelectes`, 移除了对`jquery`的依赖, 提高渲染速度
[演示站点](https://maplemei.gitee.io/xm-select/)
> 历史版本 > 历史版本
[formSelectes](https://github.com/hnzzmsf/layui-formSelects) [formSelectes](https://github.com/hnzzmsf/layui-formSelects)

2
dist/xm-select.js vendored

File diff suppressed because one or more lines are too long

View File

@ -60,10 +60,8 @@ export function watch(data) {
export function checkUserAgent(){ export function checkUserAgent(){
const ua = navigator.userAgent; const ua = navigator.userAgent;
if(ua.indexOf('Mac OS')){ if(ua.indexOf('Mac OS') != -1){
return 'mac'; return 'mac';
} }
return 'win'; return 'win';
} }

View File

@ -181,11 +181,13 @@ class General extends Component{
arr = arr.map(item => { arr = arr.map(item => {
const selected = !!sels.find(sel => sel[value] == item[value]) const selected = !!sels.find(sel => sel[value] == item[value])
const iconStyle = { const iconStyle = selected ? {
color: selected ? theme.color : '', color: theme.color,
border: 'none',
fontSize: '18px'
} : {
borderColor: theme.color, borderColor: theme.color,
} };
// const className = 'xm-option' + (item.disabled ? ' disabled' : '');
const className = ['xm-option', (item[disabled] ? ' disabled' : ''), (selected ? ' selected' : '')].join(' '); const className = ['xm-option', (item[disabled] ? ' disabled' : ''), (selected ? ' selected' : '')].join(' ');
return ( return (

View File

@ -188,14 +188,11 @@ xm-select{
color: #FFF; color: #FFF;
display: flex; display: flex;
border: @border; border: @border;
border-radius: 5px; border-radius: 3px;
&:before{ height: 18px;
height: 18px; width: 18px;
display: flex; justify-content: center;
align-items: center; align-items: center;
margin-top: -1px;
margin-bottom: -1px;
}
} }
&-content{ &-content{
@ -332,9 +329,9 @@ xm-select{
} }
xm-select[ua='win']{ // xm-select[ua='win']{
.xm-option-icon{ // .xm-option-icon{
margin-top: 0px; // margin-top: 0px;
margin-bottom: -2px; // margin-bottom: -2px;
} // }
} // }