Skip to content

Commit

Permalink
feat: support url field for tiddlywiki
Browse files Browse the repository at this point in the history
  • Loading branch information
oeyoews committed Mar 22, 2024
1 parent f18087e commit 135cf9d
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions entrypoints/popup/Popup.vue
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ fetch(`http://localhost:${port.value}/status`).then((res) => {
})
const save2TiddlyWiki = async (title: string, text: string, port: string) => {
const save2TiddlyWiki = async (title: string, text: string, port: string, url: string) => {
if (!status.value.tiddlywiki_version) {
ElMessage({
message: '请先连接 TiddlyWiki',
Expand All @@ -85,6 +85,7 @@ const save2TiddlyWiki = async (title: string, text: string, port: string) => {
body: JSON.stringify({
text, creator: username.value,
type: 'text/markdown',
url,
created: dayjs(new Date()).utc().format('YYYYMMDDHHmmss')
})
}).then((res) => {
Expand All @@ -97,8 +98,6 @@ const save2TiddlyWiki = async (title: string, text: string, port: string) => {
})
}
</script>

<template>
Expand All @@ -114,7 +113,7 @@ const save2TiddlyWiki = async (title: string, text: string, port: string) => {
</ElIcon>
</ElButton>

<ElButton @click="save2TiddlyWiki(title, md, port)">
<ElButton @click="save2TiddlyWiki(title, md, port, link)">
<FaRegularSave />
</ElButton>
</div>
Expand Down

0 comments on commit 135cf9d

Please sign in to comment.