3.0.0-alpha.10
)<div id="app">
<button @click="count++">{{count}}</button>
</div>
<script type="module">
import { createApp, ref } from 'https://unpkg.com/vue@3/dist/vue.esm-browser.js'
createApp({
setup() {
const count = ref(0)
return {
count
}
}
}).mount('#app')
</script>
<script setup lang="ts">
import { ref } from 'vue'
const count = ref(0)
</script>
<template>
<button @click="count++">{{count}}</button>
</template>
<script setup lang="ts">
import { ref } from 'vue'
const count = ref(0)
</script>
<template>
<button @click="count++">{{count}}</button>
</template>
<style scoped>
button {
padding: 0.5rem 1rem;
background-image: linear-gradient(#e242f9, #4f93f9);
}
</style>
<script setup lang="ts">
import { ref } from 'vue'
const count = ref(0)
</script>
<template>
<button @click="count++">{{count}}</button>
</template>
, computed, watchEffectconst double = computed(() => count.value* 2)watchEffect(() => console.log(count.value))
store.ts:
import { ref } from 'vue'
const count = ref(0)
Component.vue:
<script setup lang="ts">
import { count } from './store.ts'
</script>
Firebase is Google’s application development platform that helps you build, improve, and grow your app.
import { doc, onSnapshot } from "firebase/firestore"
const unsub = onSnapshot(doc(db, "cities", "SF"), (doc) => {
console.log("Current data: ", doc.data())
})
import { GoogleAuthProvider, signInWithRedirect, signInAnonymously } from 'firebase/auth'
signInWithRedirect(auth, new GoogleAuthProvider())
// or
signInAnonymously(auth)