Merge pull request #2567 from dataease/pr@dev_filter_input_style

fix: 过滤组件中的虚拟滚动组件自定义样式不生效
This commit is contained in:
dataeaseShu 2022-07-04 14:27:46 +08:00 committed by GitHub
commit 0d95b6d03d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 16 additions and 2 deletions

View File

@ -16,6 +16,8 @@
</template>
<script>
import { handlerInputStyle } from '@/components/widget/DeWidget/serviceNameFn.js'
import { uuid } from 'vue-uuid'
export default {
name: 'ElVisualSelect',
@ -106,8 +108,13 @@ export default {
}
this.options = this.newList.slice(0, this.maxLength)
},
customInputStyle() {
if (!this.$parent.$parent.handlerInputStyle) return;
handlerInputStyle(this.$refs.visualSelect.$el.querySelector('.el-input__inner'), this.$parent.element.style)
handlerInputStyle(this.$refs.visualSelect.$el.querySelector('.el-select__input'), {wordColor: this.$parent.element.style.wordColor})
},
init() {
this.customInputStyle()
if (this.defaultFirst && this.list.length > 0) {
this.selectValue = this.list[0].value
}

View File

@ -73,6 +73,12 @@ function textSelectWidget(nodeCache, style) {
}
}
function handlerInputStyle (node, style) {
styleAttrs.forEach(ele => {
node.style[attrsMap[ele]] = style[ele];
})
}
export {
attrsMap,
styleAttrs,
@ -80,5 +86,6 @@ export {
textInputWidget,
textSelectGridWidget,
textSelectTreeWidget,
textSelectWidget
textSelectWidget,
handlerInputStyle,
}