Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
S
SuperMan
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
1
Issues
1
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
罗超
SuperMan
Commits
77a60558
Commit
77a60558
authored
Aug 29, 2023
by
youjie
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of
http://gitlab.oytour.com/luochao/superman
parents
0739b60b
67a80c49
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
19 deletions
+15
-19
VEditDiv.vue
...wTravelmanager/TravelGroupControl/TravelTemp/VEditDiv.vue
+15
-19
No files found.
src/components/newTravelmanager/TravelGroupControl/TravelTemp/VEditDiv.vue
View file @
77a60558
...
...
@@ -5,7 +5,7 @@
</
template
>
<
script
>
export
default
{
props
:
[
"value"
,
"canEdit"
,
"textLength"
],
props
:
[
"value"
,
"canEdit"
,
"textLength"
],
data
()
{
return
{
innerText
:
this
.
value
,
...
...
@@ -21,26 +21,22 @@
},
methods
:
{
changeText
:
function
()
{
let
sel
=
window
.
getSelection
()
let
offset
=
sel
.
anchorOffset
if
(
this
.
$el
.
innerText
.
length
>
this
.
textLength
){
this
.
$el
.
innerText
=
this
.
$el
.
innerText
.
slice
(
0
,
3
)
let
sel
=
window
.
getSelection
();
let
offset
=
sel
.
anchorOffset
;
if
(
this
.
$el
.
innerText
.
length
>
this
.
textLength
)
{
this
.
$el
.
innerText
=
this
.
$el
.
innerText
.
slice
(
0
,
3
);
}
if
(
this
.
textLength
)
{
this
.
$el
.
innerText
=
this
.
$el
.
innerText
.
slice
(
0
,
this
.
textLength
);
}
if
(
this
.
textLength
)
this
.
$el
.
innerText
=
this
.
$el
.
innerText
.
slice
(
0
,
this
.
textLength
)
this
.
$emit
(
"input"
,
this
.
$el
.
innerText
);
// setTimeout(() => {
// var range = sel.getRangeAt(0);
// if (range) {
// var textNode = range.startContainer;
// if (textNode) {
// range.setStart(textNode, offset)
// }
// if (sel) {
// sel.removeAllRanges()
// sel.addRange(range)
// }
// }
// }, 0)
setTimeout
(()
=>
{
var
range
=
sel
.
getRangeAt
(
0
);
var
textNode
=
range
.
startContainer
;
range
.
setStart
(
textNode
,
offset
);
sel
.
removeAllRanges
();
sel
.
addRange
(
range
);
},
0
);
}
}
};
...
...
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