| | |
| | | <template> |
| | | <div class="whitespace-pre-line space-y-7"> |
| | | <div class="space-y-7"> |
| | | <div v-for="(item, index) in data" :key="index"> |
| | | <div>{{ 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)"> |
| | |
| | | </template> |
| | | |
| | | <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(`<p style="white-space:pre-line">${item.page_content}</p>`) |
| | | nwin.document.write(md.render(item.page_content)) |
| | | nwin.focus(); |
| | | if(item.metadata.Title){ |
| | | nwin.document.title = item.metadata.Title |