[Vuejs]-Cannot use typed args with Typescript and VueJS

0👍

If you’re using a vue cli build project, it’s possible that the config is not set correctly to use typescript.

Add typescript and @vue/cli-plugin-typescript

npm install --save-dev typescript @vue/cli-plugin-typescript

Also add a tsconfig.json to the root of the project.

Example:

{
  "compilerOptions": {
    "target": "esnext",
    "module": "esnext",
    "strict": true,
    "jsx": "preserve",
    "importHelpers": true,
    "moduleResolution": "node",
    "experimentalDecorators": true,
    "esModuleInterop": true,
    "allowSyntheticDefaultImports": true,
    "sourceMap": true,
    "baseUrl": ".",
    "lib": [
      "esnext",
      "dom",
      "dom.iterable",
      "scripthost"
    ]
  },
  "exclude": [
    "node_modules"
  ]
}

Leave a comment