feat(ui): 重构高级搜索组件并优化布局
- 重构 AiPullDown 组件,使用 v-model 实现双向绑定 - 优化 AiSearchBar 组件样式和布局 - 调整 AiPage 组件中的滚动条样式
This commit is contained in:
@@ -14,8 +14,11 @@
|
||||
export default {
|
||||
name: "AiPullDown",
|
||||
props: {
|
||||
target: String,
|
||||
height: {default: 4},
|
||||
value: Boolean,
|
||||
},
|
||||
model: {
|
||||
prop: 'value',
|
||||
event: 'expand'
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
@@ -25,32 +28,34 @@ export default {
|
||||
methods: {
|
||||
handleExpand() {
|
||||
this.expand = !this.expand
|
||||
if (this.target) {
|
||||
|
||||
} else this.$emit('change', this.expandStyle)
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
btnText() {
|
||||
return this.expand ? '收起高级搜索' : '展开高级搜索'
|
||||
},
|
||||
expandStyle() {
|
||||
let initStyle = {overflow: 'hidden', height: `${this.height}px`}
|
||||
this.expand && (initStyle.height = "auto")
|
||||
return initStyle
|
||||
return this.expand ? '收起' : '展开'
|
||||
},
|
||||
expandIcon() {
|
||||
return this.expand ? 'iconfont iconDouble_Up' : 'iconfont iconDouble_Down'
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.$emit("change", this.expandStyle)
|
||||
watch: {
|
||||
expand: {
|
||||
immediate: true, handler(v) {
|
||||
this.$emit('expand', v)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
.AiPullDown {
|
||||
display: flex;
|
||||
position: absolute;
|
||||
left: 0;
|
||||
right: 0;
|
||||
bottom: 24px;
|
||||
transform: translateY(100%);
|
||||
background-color: #fff;
|
||||
|
||||
.line {
|
||||
flex: 1;
|
||||
|
||||
Reference in New Issue
Block a user