forked from github/dataease
Merge pull request #3852 from dataease/pr@dev@fix_tab-position-adjust
refactor(组件): 组件位置调整限制左侧最大值
This commit is contained in:
commit
b931e05b5e
@ -29,6 +29,8 @@
|
|||||||
v-model="styleInfo.left"
|
v-model="styleInfo.left"
|
||||||
type="number"
|
type="number"
|
||||||
:min="0"
|
:min="0"
|
||||||
|
:max="maxLeft"
|
||||||
|
@change="leftOnChange"
|
||||||
class="hide-icon-number"
|
class="hide-icon-number"
|
||||||
>
|
>
|
||||||
<template slot="append">px</template>
|
<template slot="append">px</template>
|
||||||
@ -69,6 +71,8 @@
|
|||||||
|
|
||||||
<script>
|
<script>
|
||||||
|
|
||||||
|
import { mapState } from 'vuex'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'PositionAdjust',
|
name: 'PositionAdjust',
|
||||||
props: {},
|
props: {},
|
||||||
@ -76,14 +80,26 @@ export default {
|
|||||||
return {}
|
return {}
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
|
maxLeft() {
|
||||||
|
return 1600 - this.styleInfo.width - this.componentGap
|
||||||
|
},
|
||||||
styleInfo() {
|
styleInfo() {
|
||||||
return this.$store.state.curComponent.style
|
return this.$store.state.curComponent.style
|
||||||
}
|
},
|
||||||
|
...mapState([
|
||||||
|
'componentGap'
|
||||||
|
])
|
||||||
},
|
},
|
||||||
watch: {},
|
watch: {},
|
||||||
mounted() {
|
mounted() {
|
||||||
},
|
},
|
||||||
methods: {}
|
methods: {
|
||||||
|
leftOnChange() {
|
||||||
|
if (this.styleInfo.left > this.maxLeft) {
|
||||||
|
this.styleInfo.left = this.maxLeft
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user