Skip to content

Commit bcdb107

Browse files
committed
feat: add pinia and format
1 parent 9bc76a1 commit bcdb107

File tree

4 files changed

+2109
-56
lines changed

4 files changed

+2109
-56
lines changed

package.json

Lines changed: 55 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -1,54 +1,55 @@
1-
{
2-
"name": "vue3-vite-js-template",
3-
"private": true,
4-
"version": "0.0.1",
5-
"author": {
6-
"name": "coderminer",
7-
"url": "https://github.com/coderminer"
8-
},
9-
"license": "MIT",
10-
"keywords": [
11-
"vue3",
12-
"vite",
13-
"tailwindcss",
14-
"axios",
15-
"template"
16-
],
17-
"scripts": {
18-
"dev": "vite",
19-
"build": "vite build",
20-
"preview": "vite preview",
21-
"lint": "eslint --ext .vue,.js,.ts,.jsx,.tsx --fix src",
22-
"prepare": "husky install"
23-
},
24-
"dependencies": {
25-
"axios": "^0.26.1",
26-
"vue": "^3.2.25",
27-
"vue-router": "^4.0.14"
28-
},
29-
"devDependencies": {
30-
"@babel/core": "^7.17.9",
31-
"@babel/eslint-parser": "^7.17.0",
32-
"@vitejs/plugin-vue": "^2.3.1",
33-
"autoprefixer": "^10.4.4",
34-
"eslint": "^8.13.0",
35-
"eslint-config-prettier": "^8.5.0",
36-
"eslint-plugin-prettier": "^4.0.0",
37-
"eslint-plugin-vue": "^8.6.0",
38-
"husky": "^7.0.4",
39-
"lint-staged": "^12.3.8",
40-
"postcss": "^8.4.12",
41-
"prettier": "^2.6.2",
42-
"tailwindcss": "^3.0.24",
43-
"vite": "^2.9.2"
44-
},
45-
"lint-staged": {
46-
"*.{js,vue,ts,jsx,tsx}": [
47-
"prettier --write",
48-
"eslint --fix"
49-
],
50-
"*.{html,css,less,scss,md}": [
51-
"prettier --write"
52-
]
53-
}
54-
}
1+
{
2+
"name": "vue3-vite-js-template",
3+
"private": true,
4+
"version": "0.0.1",
5+
"author": {
6+
"name": "coderminer",
7+
"url": "https://github.com/coderminer"
8+
},
9+
"license": "MIT",
10+
"keywords": [
11+
"vue3",
12+
"vite",
13+
"tailwindcss",
14+
"axios",
15+
"template"
16+
],
17+
"scripts": {
18+
"dev": "vite",
19+
"build": "vite build",
20+
"preview": "vite preview",
21+
"lint": "eslint --ext .vue,.js,.ts,.jsx,.tsx --fix src",
22+
"prepare": "husky install"
23+
},
24+
"dependencies": {
25+
"axios": "^0.26.1",
26+
"pinia": "^2.0.13",
27+
"vue": "^3.2.25",
28+
"vue-router": "^4.0.14"
29+
},
30+
"devDependencies": {
31+
"@babel/core": "^7.17.9",
32+
"@babel/eslint-parser": "^7.17.0",
33+
"@vitejs/plugin-vue": "^2.3.1",
34+
"autoprefixer": "^10.4.4",
35+
"eslint": "^8.13.0",
36+
"eslint-config-prettier": "^8.5.0",
37+
"eslint-plugin-prettier": "^4.0.0",
38+
"eslint-plugin-vue": "^8.6.0",
39+
"husky": "^7.0.4",
40+
"lint-staged": "^12.3.8",
41+
"postcss": "^8.4.12",
42+
"prettier": "^2.6.2",
43+
"tailwindcss": "^3.0.24",
44+
"vite": "^2.9.2"
45+
},
46+
"lint-staged": {
47+
"*.{js,vue,ts,jsx,tsx}": [
48+
"prettier --write",
49+
"eslint --fix"
50+
],
51+
"*.{html,css,less,scss,md}": [
52+
"prettier --write"
53+
]
54+
}
55+
}

src/main.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,12 @@
11
import { createApp } from 'vue'
2-
import App from './App.vue'
2+
import { createPinia } from 'pinia'
33

4+
import App from './App.vue'
45
import router from './router'
5-
66
import './index.css'
77

88
const app = createApp(App)
9+
const pinia = createPinia()
910
app.use(router)
11+
app.use(pinia)
1012
app.mount('#app')

store/counter.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
import { defineStore } from 'pinia'
2+
3+
export const useStore = defineStore('main', {
4+
state: () => {
5+
return {
6+
counter: 0
7+
}
8+
}
9+
})

0 commit comments

Comments
 (0)