| | |
| | | <template> |
| | | <div class="space-y-7"> |
| | | <div v-for="(item, index) in data" :key="index"> |
| | | <div v-html="md.render(item.answer)"></div> |
| | | <div class="markdown-it" v-html="md.render(item.answer)"></div> |
| | | <div class="space-y-1 mt-2"> |
| | | <div v-for="(cItem, index) in item.contexts" :key="index"> |
| | | <div class="text-blue-500 cursor-pointer inline-block" @click="pageLinkClick(cItem)"> |
| | |
| | | |
| | | <script setup lang="ts"> |
| | | import { md } from '../../libs/markdown'; |
| | | import { chatComProps } from '../common'; |
| | | |
| | | |
| | | defineProps(['data']) |
| | | const props = defineProps(chatComProps); |
| | | |
| | | const pageLinkClick = (item) => { |
| | | const nwin = window.open(''); |
| | | nwin.document.write(md.render(item.page_content)) |
| | | nwin.document.write(md.render(item.page_content)); |
| | | nwin.focus(); |
| | | if(item.metadata.Title){ |
| | | nwin.document.title = item.metadata.Title |
| | | |
| | | if (item.metadata.Title) { |
| | | nwin.document.title = item.metadata.Title; |
| | | } |
| | | }; |
| | | </script> |
| | | <style scoped lang="scss"></style> |
| | | <style scoped lang="scss"> |
| | | :deep(table) { |
| | | border-collapse: collapse; |
| | | width: 100%; |
| | | thead { |
| | | background-color: #f2f2f2; |
| | | } |
| | | th, |
| | | td { |
| | | border: 1px solid #ebebeb; |
| | | padding: 8px; |
| | | text-align: center; |
| | | } |
| | | } |
| | | </style> |