mirror of
https://gitee.com/ant-design-vue/ant-design-vue.git
synced 2024-12-01 19:48:38 +08:00
优化
This commit is contained in:
parent
8dfeda8089
commit
8b95d85af9
@ -48,6 +48,7 @@ The height of the input field for the select defaults to 32px. If size is set to
|
||||
:defaultValue="['a1', 'b2']"
|
||||
style="width: 200px"
|
||||
@change="handleChange"
|
||||
@popupScroll="popupScroll"
|
||||
>
|
||||
<a-select-option v-for="i in 25" :key="(i + 9).toString(36) + i">
|
||||
{{(i + 9).toString(36) + i}}
|
||||
@ -78,6 +79,9 @@ export default {
|
||||
methods: {
|
||||
handleChange(value) {
|
||||
console.log(`Selected: ${value}`);
|
||||
},
|
||||
popupScroll(){
|
||||
console.log('popupScroll')
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -453,7 +453,7 @@
|
||||
padding-left: 0; // Override default ul/ol
|
||||
list-style: none;
|
||||
max-height: 250px;
|
||||
// overflow: auto;
|
||||
overflow: auto;
|
||||
|
||||
&-item-group-list {
|
||||
margin: 0;
|
||||
|
@ -197,7 +197,9 @@ export default {
|
||||
// visible: props.visible,
|
||||
},
|
||||
class: className,
|
||||
on: {},
|
||||
on: {
|
||||
...this.$listeners,
|
||||
},
|
||||
}
|
||||
if (props.id) {
|
||||
domProps.id = props.id
|
||||
|
@ -38,7 +38,7 @@ export default {
|
||||
watch: {
|
||||
visible (val) {
|
||||
if (!val) {
|
||||
this.lastVisible = false
|
||||
this.lastVisible = val
|
||||
}
|
||||
},
|
||||
},
|
||||
@ -51,6 +51,7 @@ export default {
|
||||
}
|
||||
this.lastVisible = props.visible
|
||||
this.lastInputValue = props.inputValue
|
||||
this.prevVisible = this.visible
|
||||
},
|
||||
methods: {
|
||||
scrollActiveItemToView () {
|
||||
@ -89,7 +90,7 @@ export default {
|
||||
firstActiveValue,
|
||||
dropdownMenuStyle,
|
||||
} = props
|
||||
const { menuDeselect, menuSelect } = this.$listeners
|
||||
const { menuDeselect, menuSelect, popupScroll } = this.$listeners
|
||||
if (menuItems && menuItems.length) {
|
||||
const selectedKeys = getSelectKeys(menuItems, value)
|
||||
const menuProps = {
|
||||
@ -103,6 +104,9 @@ export default {
|
||||
style: dropdownMenuStyle,
|
||||
ref: 'menuRef',
|
||||
}
|
||||
if (popupScroll) {
|
||||
menuProps.on.scroll = popupScroll
|
||||
}
|
||||
if (multiple) {
|
||||
menuProps.on.deselect = menuDeselect
|
||||
menuProps.on.select = menuSelect
|
||||
@ -160,7 +164,6 @@ export default {
|
||||
},
|
||||
render () {
|
||||
const renderMenu = this.renderMenu()
|
||||
this.prevVisible = this.visible
|
||||
const { popupFocus, popupScroll } = this.$listeners
|
||||
return renderMenu ? (
|
||||
<div
|
||||
|
Loading…
Reference in New Issue
Block a user