1
0
mirror of https://gitlab.com/bramw/baserow.git synced 2024-11-24 16:36:46 +00:00
bramw_baserow/web-frontend/modules/database/components/card/RowCardFieldRichText.vue
2024-04-08 19:11:52 +00:00

38 lines
782 B
Vue

<!-- eslint-disable vue/no-v-html -->
<template>
<div
class="card-rich-text field-rich-text--preview"
v-html="formattedValue"
></div>
</template>
<script>
import { parseMarkdown } from '@baserow/modules/core/editor/markdown'
export default {
props: {
value: {
type: String,
default: '',
},
workspaceId: {
type: Number,
required: true,
},
},
height: 32,
computed: {
formattedValue() {
const workspace = this.$store.getters['workspace/get'](this.workspaceId)
const loggedUserId = this.$store.getters['auth/getUserId']
return parseMarkdown(this.value, {
openLinkOnClick: true,
workspaceUsers: workspace ? workspace.users : null,
loggedUserId,
})
},
},
}
</script>