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
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 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 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 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 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 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 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 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' |
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
<template> | |
<div> | |
<input type="text" v-model="search"> | |
<input type="text" v-model="search2"> | |
</div> | |
</template> | |
<script> | |
import { ref, watch, watchEffect } from 'vue' | |
export default { |
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
<template> | |
<div> | |
<p ref="msg"></p> | |
<button type="button" | |
@click="changeMsg">click me</button> | |
</div> | |
</template> | |
<script> | |
import { ref } from 'vue' |