nuxt+ts+ant-design-vue


使用ant-design-vue

// plugins/antd-ui.ts
import Vue from 'vue'
import * as Antd from 'ant-design-vue';//一定要這樣做,方便類型檢查
Vue.use(Antd)

tsconfig.json文件

{
  "compilerOptions": {
    "target": "ES2016",
    "module": "ESNext",
    "moduleResolution": "Node",
    "lib": [
      "ESNext",
      "ESNext.AsyncIterable",
      "DOM"
    ],
    "esModuleInterop": true,
    "allowJs": true,
    "skipLibCheck": true,
    "sourceMap": true,
    "strict": true,
    "jsx": "preserve",
    "noEmit": true,
    "experimentalDecorators": true,
    "baseUrl": ".",
    "paths": {
      "~/*": [
        "*",
        "/*"
      ],
      "@/*": [
        "*",
        "/*"
      ]
    },
    "types": [
      "@types/node",
      "@nuxt/types"
    ]
  },
  "lib": [
    "es5",
    "es6",
    "es7",
    "es2015.promise",
    "esnext",
    "dom",
    "dom.iterable",
    "scripthost"
  ],
  "include": [
    "shims-vue.d.ts",
    "plugins/**/*.ts",
    "pages/**/*.vue",
    "store/**/*.ts",
    "shims-tsx.d.ts"
  ],
  "exclude": [
    "node_modules",
    ".nuxt",
    "dist"
  ]
}

 

目錄結構

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM