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 class="bg-black h-32 p-8 flex justify-around"> | |
| <div class="text-white text-4xl">Composition API Blog</div> | |
| <div class="text-white text-xl"><router-link to="/">Home</router-link></div> | |
| </div> | |
| </template> |
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 { createRouter, createWebHistory } from "vue-router"; | |
| import Home from "../views/Home.vue"; | |
| const routes = [ | |
| { | |
| path: "/", | |
| name: "Home", | |
| component: Home | |
| } | |
| ]; |
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 id="app"> | |
| <router-view /> | |
| </div> | |
| </template> |
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 class="home"></div> | |
| </template> | |
| <script> | |
| export default { | |
| name: "Home" | |
| }; | |
| </script> |
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> | |
| <div class="text-4xl font-bold">{{ post.title }}</div> | |
| <div>{{ post.body }}</div> | |
| <div class="italic mt-4"> | |
| Author: <span class="text-red-500">{{ user.name }}</span> | |
| </div> | |
| </div> | |
| </template> |
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> | |
| <div class="text-4xl font-bold">{{ post.title }}</div> | |
| <div>{{ post.body }}</div> | |
| <div class="italic mt-4">Author: <span class="text-red-500">{{ user.name }}</span></div> | |
| </div> | |
| </template> | |
| <script> | |
| export default { |
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> | |
| <img alt="Vue logo" src="./assets/logo.png" /> | |
| <teleport to="#outside_app"> | |
| <Count msg="Hello Vue 3.0 + Vite" /> | |
| </teleport> | |
| </template> | |
| <script> | |
| import Count from './components/Count.vue' |
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> | |
| <img alt="Vue logo" src="./assets/logo.png" /> | |
| <Count msg="Hello Vue 3.0 + Vite" /> | |
| </template> | |
| <script> | |
| import Count from './components/Count.vue' | |
| export default { | |
| name: 'App', | |
| components: { | |
| Count |
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
| <!DOCTYPE html> | |
| <html lang="en"> | |
| <head> | |
| <meta charset="UTF-8"> | |
| <link rel="icon" href="/favicon.ico" /> | |
| <meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
| <title>Vite App</title> | |
| </head> | |
| <body> | |
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 Vue from "vue"; | |
| import Vuex from "vuex"; | |
| import Todo from './todo' //Import the todo module | |
| import createPersistedState from 'vuex-persistedstate' | |
| Vue.use(Vuex); | |
| export default new Vuex.Store({ | |
| state: {}, | |
| mutations: {}, |