fix: RubyText 注音布局重写(外层 text→view+flex,拼音对齐汉字正上方,兼容小程序)

This commit is contained in:
2026-08-13 15:29:45 +08:00
parent 2f08d27c73
commit 01fd84a5c2
+7 -7
View File
@@ -1,10 +1,10 @@
<template>
<text class="ruby-wrap" :class="{ dark: dark }">
<text v-for="(ch, i) in pairs" :key="i" class="ruby-unit">
<view class="ruby-wrap" :class="{ dark: dark }">
<view v-for="(ch, i) in pairs" :key="i" class="ruby-unit">
<text v-if="ch.p && show" class="ruby-py">{{ ch.p }}</text>
<text class="ruby-ch">{{ ch.c }}</text>
</text>
</text>
</view>
</view>
</template>
<script>
@@ -28,14 +28,14 @@ export default {
<style scoped>
.ruby-wrap {
display: inline;
display: flex;
flex-wrap: wrap;
line-height: 1.9;
}
.ruby-unit {
display: inline-flex;
display: flex;
flex-direction: column;
align-items: center;
vertical-align: top;
margin: 0 2rpx;
}
.ruby-py {