|
@@ -1,6 +1,6 @@
|
|
|
<template>
|
|
|
<el-card shadow="never" class="h100 card">
|
|
|
- <audio ref="audioPlayerRef" :key="recordUrl" controls class="w100" style="height: 43px; padding: 0; margin: 0">
|
|
|
+ <audio ref="audioPlayerRef" :key="recordUrl" controls class="w100" style="height: 43px; padding: 0; margin: 0" preload="auto">
|
|
|
<source :src="recordUrl" type="audio/wav" />
|
|
|
</audio>
|
|
|
<el-table :data="tableData" border class="mt10">
|
|
@@ -49,9 +49,11 @@ const audioPlayerRef = ref<RefType>();
|
|
|
const recordUrl = ref('');
|
|
|
const onPlay = (row: any) => {
|
|
|
recordUrl.value = themeConfig.value.recordPrefix + row.audioFile;
|
|
|
- setTimeout(() => {
|
|
|
- audioPlayerRef.value.play();
|
|
|
- }, 100);
|
|
|
+ if (audioPlayerRef.value) {
|
|
|
+ setTimeout(() => {
|
|
|
+ audioPlayerRef.value.play();
|
|
|
+ }, 100);
|
|
|
+ }
|
|
|
};
|
|
|
const storesThemeConfig = useThemeConfig();
|
|
|
const { themeConfig } = storeToRefs(storesThemeConfig);
|