This file contains hidden or 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
| import { getAuth, signInWithPopup, FacebookAuthProvider } from "firebase/auth"; | |
| const auth = getAuth(); | |
| const providerFb = new FacebookAuthProvider(); | |
| signInWithPopup(auth, providerFb) | |
| .then((result) => { | |
| const credential = FacebookAuthProvider.credentialFromResult(result); | |
| const accessToken = credential.accessToken; | |
| const user = result.user; |
This file contains hidden or 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
| import { getAuth, getRedirectResult, GoogleAuthProvider } from "firebase/auth"; | |
| const auth = getAuth(); | |
| const providerGoogle = new GoogleAuthProvider(); | |
| getRedirectResult(auth) | |
| .then((result) => { | |
| const credential = GoogleAuthProvider.credentialFromResult(result); | |
| const token = credential.accessToken; | |
| const user = result.user; |
This file contains hidden or 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
| import { getAuth, signInWithPopup, GoogleAuthProvider } from "firebase/auth"; | |
| const auth = getAuth(); | |
| const providerGoogle = new GoogleAuthProvider(); | |
| signInWithPopup(auth, providerGoogle) | |
| .then((result) => { | |
| const credential = GoogleAuthProvider.credentialFromResult(result); | |
| const token = credential.accessToken; | |
| const user = result.user; |
This file contains hidden or 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
| module.exports = { | |
| purge: [], | |
| darkMode: false, // or 'media' or 'class' | |
| theme: { | |
| extend: {}, | |
| }, | |
| variants: { | |
| extend: {}, | |
| }, | |
| plugins: [], |
This file contains hidden or 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
| editor: | |
| fields: | |
| - { label: "標題", name: "title", widget: "string" } | |
| - { label: "日期", name: "date", widget: "date" } | |
| - { label: "內文", name: "body", widget: "markdown" } |
This file contains hidden or 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
| <template> | |
| <div> | |
| <ul> | |
| <li v-for="d in data" :key="d.id">{{ d.title }}</li> | |
| </ul> | |
| </div> | |
| </template> | |
| <script> | |
| import getDataFn from '../library/getData'; |
This file contains hidden or 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
| import { ref } from 'vue' | |
| export default function(uri) { | |
| const data = ref(null); | |
| const getData = async () => { | |
| try { | |
| const result = await fetch(uri); | |
| if(!result.ok) { |
This file contains hidden or 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
| <template> | |
| <div> | |
| <ul> | |
| <li v-for="u in users" :key="u.id">{{ u.name }}</li> | |
| </ul> | |
| </div> | |
| </template> | |
| <script> | |
| import getDataFn from '../library/getData'; |
This file contains hidden or 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
| import { ref } from 'vue' | |
| export default function() { | |
| const users = ref(null); | |
| const getData = async () => { | |
| try { | |
| const data = await fetch('https://jsonplaceholder.typicode.com/users'); | |
| if(!data.ok) { |
This file contains hidden or 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
| <template> | |
| <div> | |
| <ul> | |
| <li v-for="u in users" :key="u.id">{{ u.name }}</li> | |
| </ul> | |
| </div> | |
| </template> | |
| <script> | |
| import { ref } from 'vue' |