├── .husky ├── .gitignore ├── pre-commit ├── commit-msg └── pre-push ├── public ├── CNAME └── favicon.ico ├── commitlint.config.js ├── src ├── assets │ └── logo.png ├── common │ └── types │ │ └── index.ts ├── store │ ├── modules │ │ └── NumFactory │ │ │ ├── types.ts │ │ │ └── index.ts │ ├── types.ts │ └── index.ts ├── shims-vue.d.ts ├── main.ts ├── utils │ ├── style-import.ts │ └── axios.ts ├── views │ ├── Home.vue │ ├── Test.vue │ ├── Vuex.vue │ └── Axios.vue ├── App.vue ├── style │ └── basic.styl ├── router │ └── index.ts └── components │ ├── Header.vue │ ├── Main.vue │ └── Nav.vue ├── .prettierrc ├── tests ├── Header.spec.ts └── Test.spec.ts ├── index.html ├── jest.config.js ├── .editorconfig ├── tsconfig.json ├── .gitignore ├── .github └── workflows │ └── deploy.yml ├── .eslintrc.js ├── vite.config.ts ├── LICENSE ├── package.json ├── .cz-config.js └── README.md /.husky/.gitignore: -------------------------------------------------------------------------------- 1 | _ 2 | -------------------------------------------------------------------------------- /public/CNAME: -------------------------------------------------------------------------------- 1 | vite-vue3-starter.xpoet.cn 2 | -------------------------------------------------------------------------------- /.husky/pre-commit: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | . "$(dirname "$0")/_/husky.sh" 3 | 4 | npx lint-staged 5 | -------------------------------------------------------------------------------- /commitlint.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { extends: ['@commitlint/config-conventional'] } 2 | -------------------------------------------------------------------------------- /public/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shinevue/vite-vue3-boilerplate/HEAD/public/favicon.ico -------------------------------------------------------------------------------- /src/assets/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shinevue/vite-vue3-boilerplate/HEAD/src/assets/logo.png -------------------------------------------------------------------------------- /.husky/commit-msg: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | . "$(dirname "$0")/_/husky.sh" 3 | 4 | npx --no-install commitlint --edit 5 | -------------------------------------------------------------------------------- /.husky/pre-push: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | . "$(dirname "$0")/_/husky.sh" 3 | 4 | npm run test 5 | 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /src/common/types/index.ts: -------------------------------------------------------------------------------- 1 | export interface NavItem { 2 | path: string 3 | name: string 4 | isActive: boolean 5 | } 6 | -------------------------------------------------------------------------------- /src/store/modules/NumFactory/types.ts: -------------------------------------------------------------------------------- 1 | export default interface NumFactoryStateTypes { 2 | name: string 3 | count: number 4 | } 5 | -------------------------------------------------------------------------------- /src/shims-vue.d.ts: -------------------------------------------------------------------------------- 1 | declare module '*.vue' { 2 | import { DefineComponent } from 'vue' 3 | const component: DefineComponent<{}, {}, any> 4 | export default component 5 | } 6 | -------------------------------------------------------------------------------- /.prettierrc: -------------------------------------------------------------------------------- 1 | { 2 | "useTabs": false, 3 | "tabWidth": 2, 4 | "printWidth": 88, 5 | "singleQuote": true, 6 | "trailingComma": "none", 7 | "bracketSpacing": true, 8 | "semi": false 9 | } 10 | -------------------------------------------------------------------------------- /src/store/types.ts: -------------------------------------------------------------------------------- 1 | import NumFactoryStateTypes from './modules/NumFactory/types' 2 | 3 | export default interface RootStateTypes { 4 | text: string 5 | } 6 | 7 | export interface AllStateTypes extends RootStateTypes { 8 | numFactoryModule: NumFactoryStateTypes 9 | } 10 | -------------------------------------------------------------------------------- /src/main.ts: -------------------------------------------------------------------------------- 1 | import { createApp } from 'vue' 2 | import router from '@/router/index' 3 | import { key, store } from '@/store' 4 | import App from './App.vue' 5 | import styleImport from '@/utils/style-import' 6 | import '@/style/basic.styl' 7 | 8 | const app = createApp(App) 9 | styleImport(app).use(router).use(store, key).mount('#app') 10 | -------------------------------------------------------------------------------- /tests/Header.spec.ts: -------------------------------------------------------------------------------- 1 | import { mount } from '@vue/test-utils' 2 | // @ts-ignore 3 | import Header from '../src/components/Header.vue' 4 | 5 | describe('Header.vue', () => { 6 | it('renders', () => { 7 | const wrapper = mount(Header) 8 | expect(wrapper.html()).toContain('Vite2.x + Vue3.x + TypeScript Starter') 9 | }) 10 | }) 11 | -------------------------------------------------------------------------------- /index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 |
4 | 5 | 6 | 7 |
4 | count is: {{ count }}
5 | 6 |store Root is: {{ text }}
5 |store doubleCount is: {{ count }}
6 |