|
@@ -145,7 +145,7 @@ export default defineComponent({
|
|
|
event.on('section-click', RuntimeUtils.noteClick)
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
+ const renderData = ref()
|
|
|
// 直接读取渲染数据
|
|
|
const productJsonAndSvg = async (renderData: any) => {
|
|
|
await getSvgXml(renderData.svg)
|
|
@@ -167,18 +167,17 @@ export default defineComponent({
|
|
|
setOsdm()
|
|
|
return
|
|
|
}
|
|
|
- let renderData: any = null
|
|
|
try {
|
|
|
if (SettingState.sett.type === 'staff' && detailState.activeDetail?.musicSvg) {
|
|
|
- renderData = JSON.parse(detailState.activeDetail.musicSvg)
|
|
|
+ renderData.value = JSON.parse(detailState.activeDetail.musicSvg)
|
|
|
} else {
|
|
|
if (SettingState.sett.keySignature && detailState.activeDetail?.musicFirstSvg) {
|
|
|
//固定调
|
|
|
- renderData = JSON.parse(detailState.activeDetail.musicFirstSvg)
|
|
|
+ renderData.value = JSON.parse(detailState.activeDetail.musicFirstSvg)
|
|
|
} else {
|
|
|
// 首调
|
|
|
if (detailState.activeDetail?.musicJianSvg) {
|
|
|
- renderData = JSON.parse(detailState.activeDetail.musicJianSvg)
|
|
|
+ renderData.value = JSON.parse(detailState.activeDetail.musicJianSvg)
|
|
|
}
|
|
|
}
|
|
|
}
|
|
@@ -186,8 +185,8 @@ export default defineComponent({
|
|
|
console.error(error)
|
|
|
detailState.renderType = 'native'
|
|
|
}
|
|
|
- if (renderData && !props.isSoundEffect) {
|
|
|
- productJsonAndSvg(renderData)
|
|
|
+ if (renderData.value && !props.isSoundEffect) {
|
|
|
+ productJsonAndSvg(renderData.value)
|
|
|
} else {
|
|
|
setOsdm()
|
|
|
}
|
|
@@ -244,10 +243,18 @@ export default defineComponent({
|
|
|
}
|
|
|
|
|
|
const reRender = async () => {
|
|
|
+ if (detailState.renderType == 'native') {
|
|
|
+ await osmd.value?.render()
|
|
|
+ } else {
|
|
|
+ if (container.value) {
|
|
|
+ container.value.innerHTML = ''
|
|
|
+ }
|
|
|
+ productJsonAndSvg(renderData.value)
|
|
|
+ }
|
|
|
+ console.log(renderData.value)
|
|
|
// if (detailState.renderType == 'cache'){
|
|
|
// detailState.times = getNotePosition(detailState.times)
|
|
|
// }
|
|
|
- await osmd.value?.render()
|
|
|
}
|
|
|
|
|
|
const resetFormate = () => {
|