Skip to content

Commit

Permalink
fix: resolve markdown rendering issues in table
Browse files Browse the repository at this point in the history
  • Loading branch information
Ayideyia committed Oct 13, 2024
1 parent a5cfd50 commit 0f180bb
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 8 deletions.
12 changes: 8 additions & 4 deletions frontend/src/components/Confirm/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ marked.use({
dataSource: rows.map((row) => {
const record: Record<string, any> = {}
header.forEach(({ text }, index) => {
record[text] = row[index]?.text
record[text] = this.parser.parseInline(row[index]?.tokens || [])
})
return record
})
Expand All @@ -102,12 +102,16 @@ marked.use({
})
const mountCustomComp = (containerId: string, comp: VNode) => {
setTimeout(() => {
let count = 0
const tryToMount = () => {
if (count >= 3) return
count += 1
const div = document.getElementById(containerId)
if (!div) return
if (!div) return setTimeout(tryToMount, count * 100)
render(comp, div)
domContainers.push(() => render(null, div))
})
}
setTimeout(tryToMount)
}
const renderContent = async () => {
Expand Down
7 changes: 3 additions & 4 deletions frontend/src/components/Table/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -96,13 +96,12 @@ const tableColumns = computed(() => {
:key="column.key"
:style="{ textAlign: column.align || 'left' }"
class="select-text"
>
{{
v-html="
(column.customRender
? column.customRender({ value: getValue(data, column.key), record: data })
: getValue(data, column.key)) ?? '-'
}}
</td>
"
></td>
</tr>
</tbody>
</table>
Expand Down

0 comments on commit 0f180bb

Please sign in to comment.