Skip to content

Commit 834b9ad

Browse files
author
Erik Hanchett
committed
first commit
1 parent 23b658c commit 834b9ad

17 files changed

+807
-170
lines changed

.eslintrc.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ module.exports = {
44
node: true
55
},
66
'extends': [
7-
'plugin:vue/essential',
7+
'plugin:vue/vue3-essential',
88
'eslint:recommended',
99
'@vue/typescript/recommended'
1010
],

package-lock.json

Lines changed: 648 additions & 38 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,9 @@
99
},
1010
"dependencies": {
1111
"core-js": "^3.6.5",
12-
"vue": "^2.6.11",
13-
"vue-router": "^3.2.0",
14-
"vuex": "^3.4.0"
12+
"vue": "^3.0.0-rc.4",
13+
"vue-router": "^4.0.0-beta.4",
14+
"vuex": "^4.0.0-beta.4"
1515
},
1616
"devDependencies": {
1717
"@typescript-eslint/eslint-plugin": "^2.33.0",
@@ -22,10 +22,12 @@
2222
"@vue/cli-plugin-typescript": "~4.4.0",
2323
"@vue/cli-plugin-vuex": "~4.4.0",
2424
"@vue/cli-service": "~4.4.0",
25+
"@vue/compiler-sfc": "^3.0.0-beta.1",
2526
"@vue/eslint-config-typescript": "^5.0.2",
2627
"eslint": "^6.7.2",
27-
"eslint-plugin-vue": "^6.2.2",
28+
"eslint-plugin-vue": "^7.0.0-alpha.0",
2829
"typescript": "~3.9.3",
29-
"vue-template-compiler": "^2.6.11"
30+
"vue-cli-plugin-tailwind": "~1.4.1",
31+
"vue-cli-plugin-vue-next": "~0.1.3"
3032
}
3133
}

postcss.config.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
module.exports = {
2+
plugins: {
3+
tailwindcss: {},
4+
'vue-cli-plugin-tailwind/purgecss': {},
5+
autoprefixer: {}
6+
}
7+
}

src/App.vue

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,16 @@
11
<template>
2-
<div id="app">
2+
<div id="app" class="mt-20">
3+
<router-view />
34
<div id="nav">
4-
<router-link to="/">Home</router-link> |
5+
<router-link to="/">Home</router-link>|
56
<router-link to="/about">About</router-link>
67
</div>
7-
<router-view/>
88
</div>
99
</template>
1010

1111
<style>
1212
#app {
13+
text-align: center;
1314
font-family: Avenir, Helvetica, Arial, sans-serif;
1415
-webkit-font-smoothing: antialiased;
1516
-moz-osx-font-smoothing: grayscale;
@@ -18,7 +19,13 @@
1819
}
1920
2021
#nav {
22+
position: absolute;
23+
left: 0;
24+
right: 0;
25+
margin: auto;
26+
bottom: 0;
2127
padding: 30px;
28+
text-align: center;
2229
}
2330
2431
#nav a {

src/assets/tailwind.css

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
@tailwind base;
2+
3+
@tailwind components;
4+
5+
@tailwind utilities;

src/components/Counter.vue

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
<template>
2+
<div class="hello">
3+
<div class="bg-gray-300 h-64 w-4/6 mx-auto shadow-md flex flex-col justify-center items-center">
4+
<h3 class="text-xl font-semibold">Increment Counter</h3>
5+
<button
6+
class="bg-red-500 text-blue-900 border rounded-lg px-8 m-4 h-10 text-2xl font-bold focus:outline-none"
7+
@click="inc()"
8+
>Press Me</button>
9+
<h5 class="text-3xl">Counter: {{count.counter}}</h5>
10+
</div>
11+
</div>
12+
</template>
13+
14+
<script lang="ts">
15+
import { defineComponent, ref } from "vue";
16+
import { useStore } from "vuex";
17+
18+
export default defineComponent({
19+
setup() {
20+
const store = useStore();
21+
const count = ref(store.state);
22+
const inc = () => {
23+
store.commit("increment");
24+
};
25+
26+
return {
27+
count,
28+
inc,
29+
};
30+
},
31+
name: "HelloWorld",
32+
props: {
33+
msg: String,
34+
},
35+
methods: {},
36+
});
37+
</script>
38+
39+
<!-- Add "scoped" attribute to limit CSS to this component only -->
40+
<style scoped>
41+
h3 {
42+
margin: 40px 0 0;
43+
}
44+
ul {
45+
list-style-type: none;
46+
padding: 0;
47+
}
48+
li {
49+
display: inline-block;
50+
margin: 0 10px;
51+
}
52+
a {
53+
color: #42b983;
54+
}
55+
</style>

src/components/HelloWorld.vue

Lines changed: 0 additions & 63 deletions
This file was deleted.

src/main.ts

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,10 @@
1-
import Vue from 'vue'
2-
import App from './App.vue'
3-
import router from './router'
4-
import store from './store'
1+
import { createApp } from "vue";
2+
import App from "./App.vue";
3+
import router from "./router";
4+
import { store } from "./store";
5+
import "./assets/tailwind.css";
56

6-
Vue.config.productionTip = false
7-
8-
new Vue({
9-
router,
10-
store,
11-
render: h => h(App)
12-
}).$mount('#app')
7+
createApp(App)
8+
.use(router)
9+
.use(store)
10+
.mount("#app");

src/router/index.ts

Lines changed: 14 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,26 @@
1-
import Vue from 'vue'
2-
import VueRouter, { RouteConfig } from 'vue-router'
3-
import Home from '../views/Home.vue'
1+
import { RouteRecordRaw, createRouter, createWebHistory } from "vue-router";
2+
import Home from "../views/Home.vue";
43

5-
Vue.use(VueRouter)
6-
7-
const routes: Array<RouteConfig> = [
4+
const routes: Array<RouteRecordRaw> = [
85
{
9-
path: '/',
10-
name: 'Home',
6+
path: "/",
7+
name: "Home",
118
component: Home
129
},
1310
{
14-
path: '/about',
15-
name: 'About',
11+
path: "/about",
12+
name: "About",
1613
// route level code-splitting
1714
// this generates a separate chunk (about.[hash].js) for this route
1815
// which is lazy-loaded when the route is visited.
19-
component: () => import(/* webpackChunkName: "about" */ '../views/About.vue')
16+
component: () =>
17+
import(/* webpackChunkName: "about" */ "../views/About.vue")
2018
}
21-
]
19+
];
2220

23-
const router = new VueRouter({
24-
mode: 'history',
25-
base: process.env.BASE_URL,
21+
const router = createRouter({
22+
history: createWebHistory(process.env.BASE_URL),
2623
routes
27-
})
24+
});
2825

29-
export default router
26+
export default router;

0 commit comments

Comments
 (0)