fix
parent
6f2a45376d
commit
a88f5579b1
|
@ -1,8 +1,6 @@
|
|||
<script>
|
||||
import PropTypes from '../_util/vue-types'
|
||||
import align from 'dom-align'
|
||||
import clonedeep from 'lodash.clonedeep'
|
||||
import isEqual from 'lodash.isequal'
|
||||
import addEventListener from '../_util/Dom/addEventListener'
|
||||
import { cloneElement } from '../_util/vnode.js'
|
||||
import isWindow from './isWindow'
|
||||
|
@ -44,6 +42,7 @@ export default {
|
|||
}
|
||||
},
|
||||
mounted () {
|
||||
this.prevProps = { ...this.$props }
|
||||
const props = this.$props
|
||||
// if parent ref not attached .... use document.getElementById
|
||||
!this.aligned && this.forceAlign()
|
||||
|
@ -56,7 +55,7 @@ export default {
|
|||
const props = this.$props
|
||||
let reAlign = false
|
||||
if (!props.disabled) {
|
||||
if (prevProps.disabled || !isEqual(prevProps.align, props.align)) {
|
||||
if (prevProps.disabled || prevProps.align !== props.align) {
|
||||
reAlign = true
|
||||
} else {
|
||||
const lastTarget = prevProps.target()
|
||||
|
@ -78,6 +77,7 @@ export default {
|
|||
} else {
|
||||
this.stopMonitorWindowResize()
|
||||
}
|
||||
this.prevProps = { ...this.$props }
|
||||
},
|
||||
beforeDestroy () {
|
||||
this.stopMonitorWindowResize()
|
||||
|
@ -109,7 +109,6 @@ export default {
|
|||
},
|
||||
|
||||
render () {
|
||||
this.prevProps = clonedeep(this.$props)
|
||||
const { childrenProps } = this.$props
|
||||
const child = this.$slots.default[0]
|
||||
if (childrenProps) {
|
||||
|
|
|
@ -51,6 +51,9 @@ export default {
|
|||
prop: 'selectedKeys',
|
||||
event: 'selectChange',
|
||||
},
|
||||
mounted () {
|
||||
this.preProps = { ...this.props }
|
||||
},
|
||||
watch: {
|
||||
'$props': {
|
||||
handler: function (nextProps) {
|
||||
|
@ -74,8 +77,9 @@ export default {
|
|||
this.setState({ sOpenKeys: this.inlineOpenKeys })
|
||||
this.inlineOpenKeys = []
|
||||
}
|
||||
this.preProps = { ...nextProps }
|
||||
},
|
||||
deep: true,
|
||||
// deep: true,
|
||||
},
|
||||
'layoutContext.siderCollapsed': function (val) {
|
||||
const { openKeys, sOpenKeys, prefixCls } = this
|
||||
|
@ -196,9 +200,8 @@ export default {
|
|||
},
|
||||
},
|
||||
render () {
|
||||
const { $props, layoutContext, $slots, $listeners } = this
|
||||
const { layoutContext, $slots, $listeners } = this
|
||||
const { collapsedWidth, siderCollapsed } = layoutContext
|
||||
this.preProps = cloneDeep($props)
|
||||
this.preLayoutContext = {
|
||||
siderCollapsed,
|
||||
collapsedWidth,
|
||||
|
|
|
@ -0,0 +1,53 @@
|
|||
<script>
|
||||
import Select, { Option } from '../index'
|
||||
import '../assets/index.less'
|
||||
import { fetch } from './tbFetchSuggest'
|
||||
|
||||
export default {
|
||||
data () {
|
||||
return {
|
||||
data: [],
|
||||
value: [],
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
onChange (value) {
|
||||
console.log('onChange ', value)
|
||||
this.value = value
|
||||
},
|
||||
fetchData (value) {
|
||||
fetch(value, (data) => {
|
||||
this.data = data
|
||||
})
|
||||
},
|
||||
},
|
||||
|
||||
render () {
|
||||
const data = this.data
|
||||
const options = data.map((d) => {
|
||||
return <Option key={d.value}><i>{d.text}</i></Option>
|
||||
})
|
||||
return (<div>
|
||||
<h2>multiple suggest</h2>
|
||||
|
||||
<div>
|
||||
<Select
|
||||
value={this.value}
|
||||
labelInValue
|
||||
style={{ width: '500px' }}
|
||||
animation='slide-up'
|
||||
placeholder='搜索下'
|
||||
optionLabelProp='children'
|
||||
multiple
|
||||
notFoundContent=''
|
||||
onSearch={this.fetchData}
|
||||
onChange={this.onChange}
|
||||
filterOption={false}
|
||||
>
|
||||
{options}
|
||||
</Select>
|
||||
</div>
|
||||
</div>)
|
||||
},
|
||||
}
|
||||
</script>
|
Loading…
Reference in New Issue