Update fix, aka I forgot to use === instead of = and also forgot to add a param... also the issue is still not fixed, I guess it is in the newsView component or the desktop openNews function?

This commit is contained in:
yuanhau 2025-05-30 00:41:55 +08:00
parent 501c1762dc
commit 20006fff15
2 changed files with 4 additions and 6 deletions

View file

@ -152,7 +152,7 @@ const useArgFindRel = (title, newsOrg) => {
const similarities = [];
for (const item of contentArray.value) {
if (item.title !== title && item.contentType === "GENERAL" && item.publisher = newsOrg) {
if (item.title !== title && item.contentType === "GENERAL" && item.publisher === newsOrg) {
console.log(item.title);
const itemVector = tf(item.title);
console.log(itemVector);
@ -273,7 +273,6 @@ const openPublisher = (text: string) => {
<div>
<h3 class="text-lg">類似文章</h3>
<div
v-if="useArgFindRel(item.title).length > 0"
class="space-y-2"
>
<div
@ -281,6 +280,7 @@ const openPublisher = (text: string) => {
:key="similar.item.id"
class="p-2 bg-gray-100 rounded text-sm cursor-pointer hover:bg-gray-200"
@click="openNews(similar.item.url.hash, item.title)"
v-if="similar"
>
<div class="font-medium">{{ similar.title }}</div>
<div class="text-gray-500 text-xs">
@ -288,8 +288,8 @@ const openPublisher = (text: string) => {
{{ similar.item.publisher }}
</div>
</div>
<div v-else class="text-gray-500 text-sm">找不到類似文章</div>
</div>
<div v-else class="text-gray-500 text-sm">找不到類似文章</div>
</div>
<!--<div v-for="item in findRel(item.title)">
{{ item }}