Skip to content

Commit 23d42b3

Browse files
committed
import whole project
0 parents  commit 23d42b3

File tree

21 files changed

+1802
-0
lines changed

21 files changed

+1802
-0
lines changed

.gitignore

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
node_modules
2+
.DS_Store
3+
dist
4+
dist-ssr
5+
*.local
6+
/.history/

README.md

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
# Vue 3 + Typescript + Vite
2+
3+
This template should help get you started developing with Vue 3 and Typescript in Vite.
4+
5+
## Recommended IDE Setup
6+
7+
[VSCode](https://code.visualstudio.com/) + [Vetur](https://marketplace.visualstudio.com/items?itemName=octref.vetur). Make sure to enable `vetur.experimental.templateInterpolationService` in settings!
8+
9+
### If Using `<script setup>`
10+
11+
[`<script setup>`](https://github.com/vuejs/rfcs/pull/227) is a feature that is currently in RFC stage. To get proper IDE support for the syntax, use [Volar](https://marketplace.visualstudio.com/items?itemName=johnsoncodehk.volar) instead of Vetur (and disable Vetur).
12+
13+
## Type Support For `.vue` Imports in TS
14+
15+
Since TypeScript cannot handle type information for `.vue` imports, they are shimmed to be a generic Vue component type by default. In most cases this is fine if you don't really care about component prop types outside of templates. However, if you wish to get actual prop types in `.vue` imports (for example to get props validation when using manual `h(...)` calls), you can use the following:
16+
17+
### If Using Volar
18+
19+
Run `Volar: Switch TS Plugin on/off` from VSCode command palette.
20+
21+
### If Using Vetur
22+
23+
1. Install and add `@vuedx/typescript-plugin-vue` to the [plugins section](https://www.typescriptlang.org/tsconfig#plugins) in `tsconfig.json`
24+
2. Delete `src/shims-vue.d.ts` as it is no longer needed to provide module info to Typescript
25+
3. Open `src/main.ts` in VSCode
26+
4. Open the VSCode command palette
27+
5. Search and run "Select TypeScript version" -> "Use workspace version"
28+
29+
### Using Overmind DevTools debugger
30+
31+
Overmind DevTools: <https://overmindjs.org/core/devtools>
32+
33+
```
34+
npx overmind-devtools@latest
35+
```

index.html

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
<!DOCTYPE html>
2+
<html lang="en">
3+
<head>
4+
<meta charset="UTF-8" />
5+
<link rel="icon" href="/favicon.ico" />
6+
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
7+
<title>Vite App</title>
8+
<link href="https://unpkg.com/tailwindcss@^2/dist/tailwind.min.css" rel="stylesheet">
9+
</head>
10+
<body>
11+
<div id="app"></div>
12+
<script type="module" src="/src/main.ts"></script>
13+
</body>
14+
</html>

package.json

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
{
2+
"name": "vite-ts-overmind",
3+
"version": "0.0.0",
4+
"scripts": {
5+
"dev": "vite",
6+
"build": "vue-tsc --noEmit && vite build",
7+
"serve": "vite preview"
8+
},
9+
"dependencies": {
10+
"buffer": "^6.0.3",
11+
"overmind": "^27.0.0",
12+
"overmind-vue": "^27.0.0",
13+
"process": "^0.11.10",
14+
"vue": "^3.0.5"
15+
},
16+
"devDependencies": {
17+
"@vitejs/plugin-vue": "^1.2.1",
18+
"@vue/compiler-sfc": "^3.0.5",
19+
"typescript": "^4.1.3",
20+
"vite": "^2.1.5",
21+
"vue-tsc": "^0.0.15"
22+
}
23+
}

public/favicon.ico

4.19 KB
Binary file not shown.

src/App.vue

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
<template>
2+
<div class="flex justify-center">
3+
<img alt="Vue logo" src="./assets/logo.png" />
4+
</div>
5+
<HelloWorld msg="Hello Vue 3 + TypeScript + Vite + Overmind" />
6+
</template>
7+
8+
<script lang="ts">
9+
import { defineComponent } from "vue";
10+
import HelloWorld from "./components/HelloWorld.vue";
11+
12+
export default defineComponent({
13+
name: "App",
14+
components: {
15+
HelloWorld,
16+
},
17+
});
18+
</script>
19+
20+
<style>
21+
#app {
22+
font-family: Avenir, Helvetica, Arial, sans-serif;
23+
-webkit-font-smoothing: antialiased;
24+
-moz-osx-font-smoothing: grayscale;
25+
text-align: center;
26+
color: #2c3e50;
27+
margin-top: 60px;
28+
}
29+
</style>

src/assets/logo.png

6.69 KB
Loading

src/components/DecBtn.vue

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
<template>
2+
<button
3+
type="button"
4+
class="inline-flex items-center p-1.5 border border-transparent rounded-full shadow-sm text-white bg-indigo-600 hover:bg-indigo-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-indigo-500"
5+
>
6+
<svg
7+
class="h-5 w-5"
8+
xmlns="http://www.w3.org/2000/svg"
9+
viewBox="0 0 20 20"
10+
fill="currentColor"
11+
aria-hidden="true"
12+
>
13+
<path
14+
fill-rule="evenodd"
15+
d="M10 5a1 1 0 011 1v3h3a1 1 0 110 2h-3v3a1 1 0 11-2 0v-3H6a1 1 0 110-2h3V6a1 1 0 011-1z"
16+
clip-rule="evenodd"
17+
/>
18+
</svg>
19+
</button>
20+
</template>

src/components/HelloWorld.vue

Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
<template>
2+
<h1 class="text-2xl font-bold">{{ msg }}</h1>
3+
4+
<SimpleCounter />
5+
6+
<p>
7+
Recommended IDE setup:
8+
<a href="https://code.visualstudio.com/" target="_blank">VSCode</a>
9+
+
10+
<a
11+
href="https://marketplace.visualstudio.com/items?itemName=octref.vetur"
12+
target="_blank"
13+
>Vetur</a
14+
>
15+
or
16+
<a href="https://github.com/johnsoncodehk/volar" target="_blank">Volar</a>
17+
(if using
18+
<code>&lt;script setup&gt;</code>)
19+
</p>
20+
21+
<p>See <code>README.md</code> for more information.</p>
22+
23+
<p class="pt-2 pb-2">
24+
<a href="https://overmindjs.org/" target="_blank">Vite Docs</a>
25+
|
26+
<a href="https://overmindjs.org/" target="_blank"><b>Overmind</b> Docs</a>
27+
|
28+
<a href="https://v3.vuejs.org/" target="_blank">Vue 3 Docs</a>
29+
</p>
30+
<p>
31+
Edit
32+
<code>components/HelloWorld.vue</code> to test hot module replacement.
33+
</p>
34+
</template>
35+
36+
<script lang="ts">
37+
import { defineComponent } from "vue";
38+
import { useOvermind } from "../overmind";
39+
40+
import SimpleCounter from "./SimpleCounter.vue";
41+
42+
export default defineComponent({
43+
name: "HelloWorld",
44+
components: {
45+
SimpleCounter,
46+
},
47+
props: {
48+
msg: {
49+
type: String,
50+
required: true,
51+
},
52+
},
53+
setup() {
54+
const state = useOvermind.state();
55+
return { state };
56+
},
57+
});
58+
</script>
59+
60+
<style scoped>
61+
a {
62+
color: #42b983;
63+
}
64+
65+
label {
66+
margin: 0 0.5em;
67+
font-weight: bold;
68+
}
69+
70+
code {
71+
background-color: #eee;
72+
padding: 2px 4px;
73+
border-radius: 4px;
74+
color: #304455;
75+
}
76+
</style>

src/components/IncBtn.vue

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
<template>
2+
<button
3+
type="button"
4+
class="inline-flex items-center p-1.5 border border-transparent rounded-full shadow-sm text-white bg-indigo-600 hover:bg-indigo-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-indigo-500"
5+
>
6+
<svg
7+
class="h-5 w-5"
8+
xmlns="http://www.w3.org/2000/svg"
9+
fill="none"
10+
viewBox="0 0 24 24"
11+
stroke="currentColor"
12+
>
13+
<path
14+
stroke-linecap="round"
15+
stroke-linejoin="round"
16+
stroke-width="2"
17+
d="M18 12H6"
18+
/>
19+
</svg>
20+
</button>
21+
</template>

0 commit comments

Comments
 (0)