|
@@ -29,7 +29,7 @@
|
|
|
<span
|
|
<span
|
|
|
:style="{
|
|
:style="{
|
|
|
flexDirection: pinyinPosition === 'top' ? 'column' : 'column-reverse',
|
|
flexDirection: pinyinPosition === 'top' ? 'column' : 'column-reverse',
|
|
|
- 'align-items': getWordAlignItems(word),
|
|
|
|
|
|
|
+ 'align-items': getWordAlignItems(word, block),
|
|
|
}"
|
|
}"
|
|
|
>
|
|
>
|
|
|
<span class="pinyin" :style="getPinyinStyle(word)"> {{ getCharPinyin(word, cIndex) }}</span>
|
|
<span class="pinyin" :style="getPinyinStyle(word)"> {{ getCharPinyin(word, cIndex) }}</span>
|
|
@@ -395,8 +395,8 @@ export default {
|
|
|
return pinyinList[charIndex] || '\u200B';
|
|
return pinyinList[charIndex] || '\u200B';
|
|
|
},
|
|
},
|
|
|
// 如果汉字有字间距,拼音与汉字左对齐,如果没有则居中对齐
|
|
// 如果汉字有字间距,拼音与汉字左对齐,如果没有则居中对齐
|
|
|
- getWordAlignItems(word) {
|
|
|
|
|
- const letterSpacing = word.activeTextStyle?.letterSpacing || word.activeTextStyle?.['letter-spacing'];
|
|
|
|
|
|
|
+ getWordAlignItems(word, block) {
|
|
|
|
|
+ const letterSpacing = block.styleObj?.letterSpacing;
|
|
|
if (letterSpacing && letterSpacing !== '0' && letterSpacing !== '0px') {
|
|
if (letterSpacing && letterSpacing !== '0' && letterSpacing !== '0px') {
|
|
|
return 'flex-start';
|
|
return 'flex-start';
|
|
|
}
|
|
}
|