admin管理员组

文章数量:1122846

I am using vue3 with vue-facing-decorator but when running dev server i am seeing error in console that Uncaught SyntaxError: Invalid or unexpected token on @Component

Here is my package.json

{
  "type": "module",
  "dependencies": {
    "pinia": "^2.2.6",
    "vue": "^3.5.12",
    "vue-facing-decorator": "^3.0.4",
    "vue-router": "^4.4.5"
  },
  "devDependencies": {
    "@tsconfig/node22": "^22.0.0",
    "@types/jsdom": "^21.1.7",
    "@types/node": "^22.9.0",
    "@vitejs/plugin-vue": "^5.1.4",
    "@vitejs/plugin-vue-jsx": "^4.0.1",
    "@vitest/eslint-plugin": "1.1.7",
    "@vue/eslint-config-prettier": "^10.1.0",
    "@vue/eslint-config-typescript": "^14.1.3",
    "@vue/test-utils": "^2.4.6",
    "@vue/tsconfig": "^0.5.1",
    "eslint": "^9.14.0",
    "eslint-plugin-vue": "^9.30.0",
    "jsdom": "^25.0.1",
    "npm-run-all2": "^7.0.1",
    "prettier": "^3.3.3",
    "typescript": "~5.6.3",
    "vite": "^5.4.10",
    "vite-plugin-vue-devtools": "^7.5.4",
    "vitest": "^2.1.4",
    "vue-tsc": "^2.1.10"
  }
  }
}

tsConfig

My component where i am using vue-facing-decorator.

<script lang="ts">
import { Component, Vue, toNative } from "vue-facing-decorator";

@Component
class Workflow extends Vue {
  getState() {
    return "";
  }
}

export default toNative(Workflow);
</script>

I tries adding "experimentalDecorators": true, also look into /.

本文标签: typescriptComponent Uncaught SyntaxError Invalid or unexpected token when using vuedecoratorStack Overflow