-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
cfd546b
commit f2db4ae
Showing
3 changed files
with
64 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
import { ref, computed, watch, reactive, unref, toRaw, toRefs, watchEffect } from "vue"; | ||
import { defineStore, storeToRefs } from "pinia"; | ||
|
||
// 本store,用处在于获取、设置基础信息数据 | ||
export const useWordOriginStore = defineStore("wordOrigin", () => { | ||
let wordOriginList = reactive([ | ||
{ | ||
name: '必应', | ||
link: 'https://cn.bing.com/dict/search?q=' | ||
}, | ||
{ | ||
name: '朗文', | ||
link: 'https://www.ldoceonline.com/dictionary/' | ||
}, | ||
{ | ||
name: '剑桥', | ||
link: 'https://dictionary.cambridge.org/dictionary/english-chinese-simplified/' | ||
}, | ||
{ | ||
name: 'worldreference', | ||
link: 'https://www.wordreference.com/enzh/' | ||
} | ||
]) | ||
|
||
let wordOriginLink = ref(wordOriginList[0].link) | ||
|
||
async function updateWordOriginLink(link) { | ||
wordOriginLink.value = link | ||
} | ||
|
||
return { | ||
wordOriginLink, | ||
wordOriginList, | ||
updateWordOriginLink | ||
}; | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters