--- /dev/null
+<template>
+ <img alt="Vue logo" src="./assets/logo.png" />
+ <HelloWorld msg="Hello Vue 3 + Vite" />
+</template>
+
+<script setup>
+import HelloWorld from './components/HelloWorld.vue'
+
+// This starter template is using Vue 3 experimental <script setup> SFCs
+// Check out https://github.com/vuejs/rfcs/blob/master/active-rfcs/0040-script-setup.md
+</script>
+
+<style>
+#app {
+ font-family: Avenir, Helvetica, Arial, sans-serif;
+ -webkit-font-smoothing: antialiased;
+ -moz-osx-font-smoothing: grayscale;
+ text-align: center;
+ color: #2c3e50;
+ margin-top: 60px;
+}
+</style>
--- /dev/null
+<template>
+ <h1>{{ msg }}</h1>
+
+ <p>
+ <a href="https://vitejs.dev/guide/features.html" target="_blank">
+ Vite Documentation
+ </a>
+ |
+ <a href="https://v3.vuejs.org/" target="_blank">Vue 3 Documentation</a>
+ </p>
+
+ <button type="button" @click="state.count++">
+ count is: {{ state.count }}
+ </button>
+ <p>
+ Edit
+ <code>components/HelloWorld.vue</code> to test hot module replacement.
+ </p>
+</template>
+
+<script setup>
+import { ref } from 'vue'
+
+defineProps({
+ msg: {
+ type: String,
+ required: true
+ }
+})
+
+const count = ref(0)
+</script>
+
+<style scoped>
+a {
+ color: #42b983;
+}
+</style>
--- /dev/null
+import { createApp } from 'vue'
+import App from './App.vue'
+
+createApp(App).mount('#app')
--- /dev/null
+<template>
+ <div id="nav">
+ <router-link to="/">Home</router-link> |
+ <router-link to="/about">About</router-link>
+ </div>
+ <router-view/>
+</template>
+
+<style>
+#app {
+ font-family: Avenir, Helvetica, Arial, sans-serif;
+ -webkit-font-smoothing: antialiased;
+ -moz-osx-font-smoothing: grayscale;
+ text-align: center;
+ color: #2c3e50;
+}
+
+#nav {
+ padding: 30px;
+}
+
+#nav a {
+ font-weight: bold;
+ color: #2c3e50;
+}
+
+#nav a.router-link-exact-active {
+ color: #42b983;
+}
+</style>
--- /dev/null
+<template>
+ <h1>{{ msg }}</h1>
+
+ <p>
+ Recommended IDE setup:
+ <a href="https://code.visualstudio.com/" target="_blank">VSCode</a>
+ +
+ <a href="https://github.com/johnsoncodehk/volar" target="_blank">Volar</a>
+ </p>
+
+ <p>See <code>README.md</code> for more information.</p>
+
+ <p>
+ <a href="https://vitejs.dev/guide/features.html" target="_blank">
+ Vite Docs
+ </a>
+ |
+ <a href="https://v3.vuejs.org/" target="_blank">Vue 3 Docs</a>
+ </p>
+
+ <button type="button" @click="count++">count is: {{ count }}</button>
+ <p>
+ Edit
+ <code>components/HelloWorld.vue</code> to test hot module replacement.
+ </p>
+</template>
+
+<script setup>
+import { ref } from 'vue'
+
+defineProps({
+ msg: {
+ type: String,
+ required: true
+ }
+})
+
+const count = ref(0)
+</script>
+
+<style scoped>
+a {
+ color: #42b983;
+}
+
+label {
+ margin: 0 0.5em;
+ font-weight: bold;
+}
+
+code {
+ background-color: #eee;
+ padding: 2px 4px;
+ border-radius: 4px;
+ color: #304455;
+}
+</style>
--- /dev/null
+import { mount } from '@cypress/vue'
+import HelloWorld from '../HelloWorld.vue'
+
+describe('HelloWorld', () => {
+ it('playground', () => {
+ mount(HelloWorld, { props: { msg: 'Hello Cypress' } })
+ })
+
+ it('renders properly', () => {
+ mount(HelloWorld, { props: { msg: 'Hello Cypress' } })
+ cy.get('h1').should('contain', 'Hello Cypress')
+ })
+
+ it('adds 1 when clicking the plus button', () => {
+ mount(HelloWorld, { props: { msg: 'Hello Cypress' } })
+
+ cy.get('button')
+ .should('contain', '0')
+ .click()
+ .should('contain', '1')
+ })
+})
--- /dev/null
+import { createApp } from 'vue'
+import App from './App.vue'
+
+import router from './router'
+import store from './store'
+
+const app = createApp(App)
+
+app.use(router)
+app.use(store)
+
+app.mount('#app')
--- /dev/null
+import { createRouter, createWebHistory } from 'vue-router'
+import Home from '../views/Home.vue'
+
+const routes = [
+ {
+ path: '/',
+ name: 'Home',
+ component: Home
+ },
+ {
+ path: '/about',
+ name: 'About',
+ // route level code-splitting
+ // this generates a separate chunk (About.[hash].js) for this route
+ // which is lazy-loaded when the route is visited.
+ component: () => import('../views/About.vue')
+ }
+]
+
+const router = createRouter({
+ history: createWebHistory(import.meta.env.BASE_URL),
+ routes
+})
+
+export default router
--- /dev/null
+import { createStore } from 'vuex'
+
+export default createStore({
+ state: {
+ },
+ mutations: {
+ },
+ actions: {
+ },
+ modules: {
+ }
+})
--- /dev/null
+<template>
+ <div class="about">
+ <h1>This is an about page</h1>
+ </div>
+</template>
--- /dev/null
+<template>
+ <img alt="Vue logo" src="@/assets/logo.png" />
+ <HelloWorld msg="Hello Vue 3 + Vite" />
+</template>
+
+<script setup>
+import HelloWorld from '@/components/HelloWorld.vue'
+</script>
+
+<style>
+#app {
+ font-family: Avenir, Helvetica, Arial, sans-serif;
+ -webkit-font-smoothing: antialiased;
+ -moz-osx-font-smoothing: grayscale;
+ text-align: center;
+ color: #2c3e50;
+ margin-top: 60px;
+}
+</style>
--- /dev/null
+<template>
+ <img alt="Vue logo" src="./assets/logo.png" />
+ <HelloWorld msg="Hello Vue 3 + TypeScript + Vite" />
+</template>
+
+<script setup lang="ts">
+import HelloWorld from './components/HelloWorld.vue'
+</script>
+
+<style>
+#app {
+ font-family: Avenir, Helvetica, Arial, sans-serif;
+ -webkit-font-smoothing: antialiased;
+ -moz-osx-font-smoothing: grayscale;
+ text-align: center;
+ color: #2c3e50;
+ margin-top: 60px;
+}
+</style>
--- /dev/null
+<template>
+ <h1>{{ msg }}</h1>
+
+ <p>
+ Recommended IDE setup:
+ <a href="https://code.visualstudio.com/" target="_blank">VSCode</a>
+ +
+ <a href="https://github.com/johnsoncodehk/volar" target="_blank">Volar</a>
+ </p>
+
+ <p>See <code>README.md</code> for more information.</p>
+
+ <p>
+ <a href="https://vitejs.dev/guide/features.html" target="_blank">
+ Vite Docs
+ </a>
+ |
+ <a href="https://v3.vuejs.org/" target="_blank">Vue 3 Docs</a>
+ </p>
+
+ <button type="button" @click="count++">count is: {{ count }}</button>
+ <p>
+ Edit
+ <code>components/HelloWorld.vue</code> to test hot module replacement.
+ </p>
+</template>
+
+<script setup lang="ts">
+import { ref } from 'vue'
+
+defineProps<{
+ msg: String,
+}>()
+
+const count = ref(0)
+</script>
+
+<style scoped>
+a {
+ color: #42b983;
+}
+
+label {
+ margin: 0 0.5em;
+ font-weight: bold;
+}
+
+code {
+ background-color: #eee;
+ padding: 2px 4px;
+ border-radius: 4px;
+ color: #304455;
+}
+</style>
--- /dev/null
+import { createApp } from 'vue'
+import App from './App.vue'
+
+createApp(App).mount('#app')
--- /dev/null
+{
+ "dependencies": {
+ "vue-router": "^4.0.10",
+ "vuex": "^4.0.2"
+ }
+}
</template>
<script setup lang="ts">
-import { ref, defineComponent } from 'vue'
-
-defineProps({
- msg: {
- type: String,
- required: true
- }
-})
+import { ref } from 'vue'
+
+defineProps<{
+ msg: String,
+}>()
const count = ref(0)
</script>
-import { createRouter, createWebHistory, RouteRecordRaw } from 'vue-router'
+import { createRouter, createWebHistory } from 'vue-router'
+import type { RouteRecordRaw } from 'vue-router'
+
import Home from '../views/Home.vue'
const routes: Array<RouteRecordRaw> = [