|
@@ -36,22 +36,34 @@ export default {
|
|
|
data() {
|
|
|
return {
|
|
|
isShow: false,
|
|
|
+ labelStr: null,
|
|
|
};
|
|
|
},
|
|
|
mounted() {
|
|
|
this.$nextTick((res) => {
|
|
|
this.isShow =
|
|
|
- (this.$refs?.select?.disabled || false) && this.labelStr.length > 0;
|
|
|
+ (this.$refs?.select?.disabled || false) && this.labelStr?.length > 0;
|
|
|
});
|
|
|
},
|
|
|
- computed: {
|
|
|
- labelStr() {
|
|
|
+ // computed: {
|
|
|
+ // labelStr() {
|
|
|
+ // const { selected } = this.$refs.select;
|
|
|
+ // let labelStr = selected
|
|
|
+ // .map((item) => (item.label ? item.label : item.value))
|
|
|
+ // .join(",");
|
|
|
+ // return labelStr;
|
|
|
+ // },
|
|
|
+ // },
|
|
|
+ watch: {
|
|
|
+ '$attrs.value': function(newVal, oldVal) {
|
|
|
+ // 优化页面使用多组件时,tooltip不显示的问题
|
|
|
const { selected } = this.$refs.select;
|
|
|
let labelStr = selected
|
|
|
.map((item) => (item.label ? item.label : item.value))
|
|
|
.join(",");
|
|
|
- return labelStr;
|
|
|
- },
|
|
|
+ this.labelStr = labelStr
|
|
|
+ this.isShow = (this.$refs?.select?.disabled || false) && this.labelStr?.length > 0
|
|
|
+ }
|
|
|
},
|
|
|
methods: {
|
|
|
selectAll() {
|