mirror of
https://github.com/tidys/cc-inspector-chrome
synced 2025-04-20 00:48:43 +00:00
有省略号再显示tooltip
This commit is contained in:
parent
87a5a0dd16
commit
fb5f3f8817
@ -10,8 +10,8 @@
|
||||
:class="fold?'el-icon-caret-right':'el-icon-caret-bottom'"
|
||||
:style="{'visibility':isArrayOrObject()?'visible':'hidden','margin-left':indent*10+'px'}">
|
||||
</i>
|
||||
<div class="text">
|
||||
<el-popover placement="top" trigger="click">
|
||||
<div class="text" ref="propText">
|
||||
<el-popover placement="top" trigger="hover" :disabled="!isShowTooltip()">
|
||||
<div>{{ name }}</div>
|
||||
<span slot="reference">{{ name }}</span>
|
||||
</el-popover>
|
||||
@ -205,6 +205,17 @@ export default class UiProp extends Vue {
|
||||
created() {
|
||||
}
|
||||
|
||||
isShowTooltip() {
|
||||
const el: HTMLDivElement = this.$refs.propText;
|
||||
if (el) {
|
||||
if (el.scrollWidth > el.offsetWidth) {
|
||||
// 出现了省略号
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
getEngineTypeIcon() {
|
||||
const value = this.value as EngineData;
|
||||
switch (value.engineType) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user