diff --git a/frontend/src/components/ElVisualSelect/index.vue b/frontend/src/components/ElVisualSelect/index.vue index 4bdf28be55..844c8ba0f9 100644 --- a/frontend/src/components/ElVisualSelect/index.vue +++ b/frontend/src/components/ElVisualSelect/index.vue @@ -114,11 +114,13 @@ export default { 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 } - if (!this.list || !this.list.length) return + if (!this.list || !this.list.length) { + this.customInputStyle() + return + } const selectDom = document.querySelector( `.${this.classId} .el-select-dropdown .el-select-dropdown__wrap` @@ -133,6 +135,7 @@ export default { this.addScrollDiv(this.slectBoxDom) this.scrollFn() + this.customInputStyle() }, scrollFn() { diff --git a/frontend/src/components/widget/DeWidget/serviceNameFn.js b/frontend/src/components/widget/DeWidget/serviceNameFn.js index a05fba6bd0..61444f0000 100644 --- a/frontend/src/components/widget/DeWidget/serviceNameFn.js +++ b/frontend/src/components/widget/DeWidget/serviceNameFn.js @@ -74,6 +74,7 @@ function textSelectWidget(nodeCache, style) { } function handlerInputStyle (node, style) { + if (!node) return; styleAttrs.forEach(ele => { node.style[attrsMap[ele]] = style[ele]; })