Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
P
pet-business-web
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
刘怀志
pet-business-web
Commits
ec2053b9
Commit
ec2053b9
authored
Aug 23, 2023
by
陈明豪
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
bug修改
parent
ebd5ba7e
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
61 additions
and
0 deletions
+61
-0
InputTips.vue
src/components/InputTips/InputTips.vue
+61
-0
No files found.
src/components/InputTips/InputTips.vue
0 → 100644
View file @
ec2053b9
<
template
>
<el-tooltip
:content=
"text"
placement=
"top-start"
:disabled=
"tipDisabled"
>
<el-input
v-model=
"text"
readonly=
"true"
disabled=
"true"
:style=
"
{width: width}"
@mouseover.native="inputOnMouseOver($event)"
/>
</el-tooltip>
</
template
>
<
script
>
export
default
{
name
:
'InputTips'
,
props
:
{
// 输入框内容
text
:
{
type
:
String
,
default
:
null
},
// 保留的字符长度
saveLength
:
{
type
:
Number
,
default
:
9999999
},
// 输入框宽度
width
:
{
type
:
String
,
default
:
'100%'
}
},
data
()
{
return
{
tipContent
:
null
,
tipDisabled
:
false
}
},
watch
:
{},
created
()
{
},
methods
:
{
inputOnMouseOver
(
event
)
{
const
target
=
event
.
target
// 判断是否开启tooltip功能
if
(
target
.
offsetWidth
<
target
.
scrollWidth
)
{
this
.
tipDisabled
=
false
}
else
{
this
.
tipDisabled
=
true
}
}
}
}
</
script
>
<
style
scoped
lang=
"scss"
>
::v-deep
.el-input__inner
{
text-overflow
:
ellipsis
}
</
style
>
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment