|
@@ -1372,7 +1372,6 @@ export default () => {
|
|
|
const url = await uploadFileToS3(file)
|
|
const url = await uploadFileToS3(file)
|
|
|
element.src = url // 替换为远程 URL
|
|
element.src = url // 替换为远程 URL
|
|
|
|
|
|
|
|
- // 使用 slidesStore.updateElement 方法更新元素,确保 Vue 能够检测到变化
|
|
|
|
|
const slidesStore = useSlidesStore()
|
|
const slidesStore = useSlidesStore()
|
|
|
slidesStore.updateElement({ id: element.id, props: { src: url } })
|
|
slidesStore.updateElement({ id: element.id, props: { src: url } })
|
|
|
}
|
|
}
|
|
@@ -1411,6 +1410,9 @@ export default () => {
|
|
|
const file = dataToFile(el.blob, `audio_${Date.now()}.mp3`, el.blob.type)
|
|
const file = dataToFile(el.blob, `audio_${Date.now()}.mp3`, el.blob.type)
|
|
|
const url = await uploadFileToS3(file)
|
|
const url = await uploadFileToS3(file)
|
|
|
element.src = url
|
|
element.src = url
|
|
|
|
|
+
|
|
|
|
|
+ const slidesStore = useSlidesStore()
|
|
|
|
|
+ slidesStore.updateElement({ id: element.id, props: { src: url } })
|
|
|
}
|
|
}
|
|
|
catch (error) {
|
|
catch (error) {
|
|
|
console.error('Audio upload failed:', error)
|
|
console.error('Audio upload failed:', error)
|
|
@@ -1449,6 +1451,9 @@ export default () => {
|
|
|
}
|
|
}
|
|
|
const url = await uploadFileToS3(file)
|
|
const url = await uploadFileToS3(file)
|
|
|
element.src = url
|
|
element.src = url
|
|
|
|
|
+
|
|
|
|
|
+ const slidesStore = useSlidesStore()
|
|
|
|
|
+ slidesStore.updateElement({ id: element.id, props: { src: url } })
|
|
|
}
|
|
}
|
|
|
catch (error) {
|
|
catch (error) {
|
|
|
console.error('Video upload failed:', error)
|
|
console.error('Video upload failed:', error)
|