@@ -55,10 +55,11 @@ const aniRef = ref(null)
55
55
const strokesRef = ref (null )
56
56
const pinyinRet = ref (props .pinyin )
57
57
const bushouRet = shallowRef ([{}])
58
- const bihuaCountRet = shallowRef ([props .bihuashu ])
59
58
const bihuaNameRet = shallowRef ([props .bihua ])
60
59
const zuciRet = shallowRef (props .zuci )
61
60
61
+ const bihuaCount = ref (props .bihuashu )
62
+
62
63
const chengyuRef = computed (() => {
63
64
if (props .chengyu .length > 0 ) {
64
65
return props .chengyu .slice (0 , 4 )
@@ -103,12 +104,15 @@ onMounted(() => {
103
104
},
104
105
})
105
106
107
+ if (! bihuaCount .value ) {
108
+ bihuaCount .value = cnchar .stroke (props .zi )
109
+ }
106
110
// 笔顺
107
111
cnchar .draw (props .zi , {
108
112
el: strokesRef .value ,
109
113
type: cnchar .draw .TYPE .STROKE ,
110
114
style: {
111
- length: 45 ,
115
+ length: bihuaCount . value <= 18 ? 45 : 35 ,
112
116
showOutline: false ,
113
117
},
114
118
line: {
@@ -127,12 +131,7 @@ onMounted(() => {
127
131
bushouRet .value = cnchar .radical (props .zi )
128
132
speehTxt .value .push (props .jiegou || bushouRet .value [0 ].struct )
129
133
speehTxt .value .push (' 笔画数' )
130
- if (! props .bihuashu ) {
131
- bihuaCountRet .value = cnchar .stroke (props .zi , ' order' , ' count' )
132
- speehTxt .value .push (bihuaCountRet .value )
133
- } else {
134
- speehTxt .value .push (props .bihuashu )
135
- }
134
+ speehTxt .value .push (bihuaCount .value )
136
135
speehTxt .value .push (' 笔顺' )
137
136
if (props .bihua === null || props .bihua .length === 0 ) {
138
137
bihuaNameRet .value = cnchar .stroke (props .zi , ' order' , ' name' )
@@ -202,7 +201,7 @@ function handleRead() {
202
201
:height =" 32"
203
202
/>
204
203
<div class =" hanzi-container" >
205
- <div ref =" printRef" class =" print hanzi-card" />
204
+ <div ref =" printRef" class =" hanzi-card print " />
206
205
<div ref =" aniRef" class =" hanzi-card animation" />
207
206
<div class =" hanzi-controls" >
208
207
<button class =" btn-voice btn" title =" 发音" @click =" handleVoice" />
@@ -242,9 +241,7 @@ function handleRead() {
242
241
<span class =" label" >
243
242
<span class =" tag" >笔画数</span >
244
243
</span >
245
- <span class =" content" >{{
246
- props.bihuashu || bihuaCountRet[0]
247
- }}</span >
244
+ <span class =" content" >{{ bihuaCount }}</span >
248
245
</div >
249
246
<div class =" info bihua" >
250
247
<span class =" label" >
0 commit comments