Skip to content

Commit 7e856c5

Browse files
committed
Init Project with TS
1 parent d41f098 commit 7e856c5

File tree

8 files changed

+166
-53
lines changed

8 files changed

+166
-53
lines changed

package.json

+8-3
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,15 @@
88
"lint": "vue-cli-service lint"
99
},
1010
"dependencies": {
11+
"@mdi/font": "5.9.55",
1112
"core-js": "^3.6.5",
1213
"register-service-worker": "^1.7.1",
14+
"roboto-fontface": "*",
1315
"vue": "^2.6.11",
1416
"vue-class-component": "^7.2.3",
1517
"vue-property-decorator": "^9.1.2",
1618
"vue-router": "^3.2.0",
19+
"vuetify": "^2.4.0",
1720
"vuex": "^3.4.0"
1821
},
1922
"devDependencies": {
@@ -32,9 +35,11 @@
3235
"eslint-plugin-prettier": "^3.3.1",
3336
"eslint-plugin-vue": "^6.2.2",
3437
"prettier": "^2.2.1",
35-
"sass": "^1.26.5",
36-
"sass-loader": "^8.0.2",
38+
"sass": "~1.32.0",
39+
"sass-loader": "^10.0.0",
3740
"typescript": "~4.1.5",
38-
"vue-template-compiler": "^2.6.11"
41+
"vue-cli-plugin-vuetify": "~2.4.1",
42+
"vue-template-compiler": "^2.6.11",
43+
"vuetify-loader": "^1.7.0"
3944
}
4045
}

public/index.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<!DOCTYPE html>
2-
<html lang="">
2+
<html lang="en">
33
<head>
44
<meta charset="utf-8">
55
<meta http-equiv="X-UA-Compatible" content="IE=edge">

src/main.ts

+2
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,13 @@ import App from "./App.vue";
33
import "./registerServiceWorker";
44
import router from "./router";
55
import store from "./store";
6+
import vuetify from "./plugins/vuetify";
67

78
Vue.config.productionTip = false;
89

910
new Vue({
1011
router,
1112
store,
13+
vuetify,
1214
render: (h) => h(App),
1315
}).$mount("#app");

src/plugins/vuetify.ts

+23
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
import Vue from "vue";
2+
import Vuetify from "vuetify/lib/framework";
3+
4+
Vue.use(Vuetify);
5+
6+
export default new Vuetify({
7+
theme: {
8+
options: {
9+
customProperties: true,
10+
},
11+
themes: {
12+
light: {
13+
primary: "#007BFF",
14+
secondary: "#424242",
15+
accent: "#82B1FF",
16+
error: "#FF5252",
17+
info: "#2196F3",
18+
success: "#4CAF50",
19+
warning: "#FFC107",
20+
},
21+
},
22+
},
23+
});

src/router/index.ts

+9-13
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,24 @@
1-
import Vue from "vue";
2-
import VueRouter, { RouteConfig } from "vue-router";
3-
import Home from "../views/Home.vue";
1+
import Vue from 'vue';
2+
import VueRouter, { RouteConfig } from 'vue-router';
43

54
Vue.use(VueRouter);
65

76
const routes: Array<RouteConfig> = [
87
{
9-
path: "/",
10-
name: "Home",
11-
component: Home,
8+
path: '/',
9+
name: 'Home',
10+
component: () => import(/* webpackChunkName: "home" */ '../views/Home.vue'),
1211
},
1312
{
14-
path: "/about",
15-
name: "About",
16-
// route level code-splitting
17-
// this generates a separate chunk (about.[hash].js) for this route
18-
// which is lazy-loaded when the route is visited.
13+
path: '/about',
14+
name: 'About',
1915
component: () =>
20-
import(/* webpackChunkName: "about" */ "../views/About.vue"),
16+
import(/* webpackChunkName: "about" */ '../views/About.vue'),
2117
},
2218
];
2319

2420
const router = new VueRouter({
25-
mode: "history",
21+
mode: 'history',
2622
base: process.env.BASE_URL,
2723
routes,
2824
});

src/shims-vuetify.d.ts

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
declare module "vuetify/lib/framework" {
2+
import Vuetify from "vuetify";
3+
export default Vuetify;
4+
}

vue.config.js

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
module.exports = {
2+
transpileDependencies: ["vuetify"],
3+
};

0 commit comments

Comments
 (0)