├── .editorconfig ├── .eslintrc.js ├── .gitignore ├── .prettierrc ├── README.md ├── app.vue ├── composables └── test.ts ├── nuxt.config.ts ├── package.json ├── tests └── aaa.spec.ts ├── tsconfig.json └── yarn.lock /.editorconfig: -------------------------------------------------------------------------------- 1 | # http://editorconfig.org 2 | root = true 3 | 4 | [*] 5 | indent_style = space 6 | indent_size = 2 7 | charset = utf-8 8 | trim_trailing_whitespace = true 9 | insert_final_newline = true 10 | max_length = 80 11 | [*.md] 12 | trim_trailing_whitespace = false 13 | -------------------------------------------------------------------------------- /.eslintrc.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | // 此项是用来告诉eslint找当前配置文件不能往父级查找 3 | root: true, 4 | // 全局环境 5 | env: { 6 | node: true, 7 | browser: true, 8 | jest: true 9 | }, 10 | // 指定如何解析语法。可以为空,但若不为空,只能配该值 11 | parser: 'vue-eslint-parser', 12 | // 优先级低于parse的语法解析配置 13 | parserOptions: { 14 | // 指定ESlint的解析器 15 | parser: '@typescript-eslint/parser', 16 | // 允许使用ES语法 17 | ecmaVersion: 2020, 18 | // 允许使用import 19 | sourceType: 'module', 20 | // 允许解析JSX 21 | ecmaFeatures: { 22 | jsx: true, 23 | tsx: true 24 | } 25 | }, 26 | extends: [ 27 | 'plugin:vue/vue3-essential', 28 | 'plugin:vue/vue3-recommended', 29 | 'plugin:prettier/recommended' 30 | ], 31 | plugins: ['vue', '@typescript-eslint'], 32 | settings: { 33 | 'import/extensions': ['.vue', '.js', '.jsx', '.ts', '.tsx', '.json'], 34 | 'import/resolver': { 35 | node: { 36 | extensions: ['.vue', '.js', '.jsx', '.ts', '.tsx', '.json'] 37 | }, 38 | typescript: { 39 | extensions: ['.vue', '.js', '.jsx', '.ts', '.tsx', '.json'] 40 | } 41 | } 42 | }, 43 | rules: {} 44 | } 45 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | *.log 3 | .nuxt 4 | nuxt.d.ts 5 | .output 6 | .env -------------------------------------------------------------------------------- /.prettierrc: -------------------------------------------------------------------------------- 1 | { 2 | "printWidth": 80, 3 | "singleQuote": true, 4 | "trailingComma": "none", 5 | "bracketSpacing": true, 6 | "semi": false, 7 | "endOfLine": "auto", 8 | "jsxSingleQuote": false, 9 | "overrides": [ 10 | { 11 | "files": ".prettierrc", 12 | "options": { 13 | "parser": "json" 14 | } 15 | } 16 | ] 17 | } -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Nuxt 3 Minimal Starter 2 | 3 | We recommend to look at the [documentation](https://v3.nuxtjs.org). 4 | 5 | ## Setup 6 | 7 | Make sure to install the dependencies 8 | 9 | ```bash 10 | yarn install 11 | ``` 12 | 13 | ## Development 14 | 15 | Start the development server on http://localhost:3000 16 | 17 | ```bash 18 | yarn dev 19 | ``` 20 | 21 | ## Production 22 | 23 | Build the application for production: 24 | 25 | ```bash 26 | yarn build 27 | ``` 28 | 29 | Checkout the [deployment documentation](https://v3.nuxtjs.org/docs/deployment). -------------------------------------------------------------------------------- /app.vue: -------------------------------------------------------------------------------- 1 | 6 | 11 | -------------------------------------------------------------------------------- /composables/test.ts: -------------------------------------------------------------------------------- 1 | const abc = 'abc' 2 | -------------------------------------------------------------------------------- /nuxt.config.ts: -------------------------------------------------------------------------------- 1 | import { defineNuxtConfig } from 'nuxt3' 2 | 3 | // https://v3.nuxtjs.org/docs/directory-structure/nuxt.config 4 | export default defineNuxtConfig({}) 5 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "private": true, 3 | "scripts": { 4 | "dev": "nuxi dev", 5 | "build": "nuxi build", 6 | "start": "node .output/server/index.mjs", 7 | "lint": "eslint --ext .ts,.js,.vue .", 8 | "test": "jest" 9 | }, 10 | "devDependencies": { 11 | "@types/jest": "^27.0.3", 12 | "@typescript-eslint/eslint-plugin": "^5.7.0", 13 | "@typescript-eslint/parser": "^5.7.0", 14 | "eslint": "^8.4.1", 15 | "eslint-config-airbnb-base": "^15.0.0", 16 | "eslint-config-prettier": "^8.3.0", 17 | "eslint-plugin-import": "^2.25.3", 18 | "eslint-plugin-prettier": "^4.0.0", 19 | "eslint-plugin-vue": "^8.2.0", 20 | "prettier": "^2.5.1", 21 | "typescript": "^4.5.4", 22 | "vue-eslint-parser": "^8.0.1" 23 | }, 24 | "dependencies": { 25 | "nuxt3": "latest" 26 | } 27 | } -------------------------------------------------------------------------------- /tests/aaa.spec.ts: -------------------------------------------------------------------------------- 1 | // Step 1: 定义一个测试套 Test Suite 2 | describe('tree', () => { 3 | // Step 2: 定义一个单元测试 Test 4 | // i think 'tree should render correctly' 5 | it('tree should render correctly', () => { 6 | // Step 3: 期望(expect)tree组件的class里面包含(toContain)'devui-tree' 7 | expect(wrapper.classes()).toContain('devui-tree') 8 | 9 | // 期望(expect)tree组件的子元素数量为(toBe)6 10 | expect(wrapper.element.childElementCount).toBe(6) 11 | }) 12 | }) 13 | -------------------------------------------------------------------------------- /tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | // https://v3.nuxtjs.org/concepts/typescript 3 | "extends": "./.nuxt/tsconfig.json" 4 | } 5 | --------------------------------------------------------------------------------