|
@@ -127,18 +127,22 @@ export default {
|
|
|
var currentIndex = 0
|
|
|
var currentIndex1 = 0
|
|
|
for(var i = 0;i<data.length;i++){
|
|
|
+ var a = data[i].text
|
|
|
+ if(data[i].text.indexOf(' ')!=-1){
|
|
|
+ a = data[i].text.replace(/ /g,' ')
|
|
|
+ }
|
|
|
if(data[i].type == 'text'){
|
|
|
if(this.selectObj.startIndex >= currentIndex && this.selectObj.startIndex<currentIndex + data[i].text.length && !sign){
|
|
|
startIndex = i
|
|
|
sign = true
|
|
|
}else{
|
|
|
if(!sign){
|
|
|
- if(data[i].text.indexOf(' ')!=-1){
|
|
|
- var a = data[i].text.replace(/ /g,' ')
|
|
|
- currentIndex += a.length
|
|
|
- continue
|
|
|
- }
|
|
|
- currentIndex += data[i].text.length
|
|
|
+ // if(data[i].text.indexOf(' ')!=-1){
|
|
|
+ // var a = data[i].text.replace(/ /g,' ')
|
|
|
+ // currentIndex += a.length
|
|
|
+ // continue
|
|
|
+ // }
|
|
|
+ currentIndex += a.length
|
|
|
}
|
|
|
|
|
|
}
|
|
@@ -146,12 +150,12 @@ export default {
|
|
|
endIndex = i
|
|
|
break
|
|
|
}else{
|
|
|
- if(data[i].text.indexOf(' ')!=-1){
|
|
|
- var a = data[i].text.replace(/ /g,' ')
|
|
|
- currentIndex1 += a.length
|
|
|
- continue
|
|
|
- }
|
|
|
- currentIndex1 += data[i].text.length
|
|
|
+ // if(data[i].text.indexOf(' ')!=-1 && sign){
|
|
|
+ // var a = data[i].text.replace(/ /g,' ')
|
|
|
+ // currentIndex1 += a.length
|
|
|
+ // continue
|
|
|
+ // }
|
|
|
+ currentIndex1 += a.length
|
|
|
}
|
|
|
}
|
|
|
}
|