react-region-picker
Version:
react hooks版本 城市地区联动
123 lines (121 loc) • 2.4 kB
CSS
ul {
list-style: none;
padding: 0;
margin: 0;
}
.w-picker-container {
text-align: left;
box-sizing: border-box;
}
.w-picker-container .picker-region {
min-width: 100px;
min-height: 20px;
}
.w-picker-container .picker-region .placeholder {
color: #999;
}
.w-picker-container .w-picker-popup.show {
display: block;
}
.w-picker-container .w-picker-popup.hide {
display: none;
}
.w-picker-mask {
position: fixed;
top: 0;
right: 0;
bottom: 0;
left: 0;
z-index: 1000;
transform: translateZ(1px);
background-color: rgba(0, 0, 0, 0.4);
}
.w-picker-header {
position: relative;
height: 44px;
font-size: 15px;
display: flex;
padding: 0 20px;
align-items: center;
justify-content: space-between;
}
.w-picker-header .no-data {
color: #999;
}
.w-picker-header .picker-header_tab {
display: flex;
align-items: center;
flex: 1;
height: 100%;
max-width: 85%;
}
.w-picker-header .picker-header_tab .choose-item {
display: flex;
align-items: center;
height: 100%;
font-weight: bold;
padding: 0 5px;
max-width: 33%;
}
.w-picker-header .picker-header_tab .choose-item span {
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
.w-picker-header .picker-header_tab .choose-item:not(:last-child) {
margin-right: 25px;
}
.w-picker-header .picker-header_tab .choose-item.selected {
border-bottom: 2px solid #1DA1F2;
}
.w-picker-header .picker-header_right {
color: #1DA1F2;
}
.w-picker-header::after {
content: ' ';
position: absolute;
bottom: 0;
left: 0;
right: 0;
border-bottom: 1px solid #f0f0f0;
transform: scaleY(0.5);
}
.w-picker-body {
position: fixed;
bottom: 0;
left: 0;
width: 100%;
background-color: #fff;
z-index: 1001;
}
.w-picker-body .w-picker {
display: flex;
font-size: 15px;
}
.w-picker-body .w-picker .picker-list {
width: 100%;
display: none;
height: 307px;
overflow: auto;
color: #242424;
}
.w-picker-body .w-picker .picker-list.show {
display: block;
}
.w-picker-body .w-picker .picker-list li {
position: relative;
padding: 10px 24px;
}
.w-picker-body .w-picker .picker-list li.selected {
color: #1DA1F2;
}
.w-picker-body .w-picker .picker-list li.selected::after {
position: absolute;
right: 20px;
content: ' ';
width: 5px;
height: 10px;
border-bottom: 2px solid #1DA1F2;
border-right: 2px solid #1DA1F2;
transform: rotate(45deg);
}