Created
February 5, 2022 15:08
-
-
Save kazuooooo/18c34827f64440295d33b2f1af4a1ddb to your computer and use it in GitHub Desktop.
sample1.ts
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
export const useExampleStore = defineStore('expamle', { | |
state: {/*...*/} | |
actions: { | |
async setup() { | |
// ... | |
//🌟 docDataとdocRefを同期 | |
onSnapshot(docRef, (ds) => { | |
if (ds.exists()) { | |
this.$patch({ docData: ds.data() }) | |
} | |
}) | |
} | |
} | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment