Coder Social home page Coder Social logo

Comments (2)

StringKe avatar StringKe commented on July 19, 2024
ERROR in src/views/Home.vue:4:1
TS1238: Unable to resolve signature of class decorator when called as an expression.
  Type 'VueConstructor<Vue<unknown, never[], {}>>' is not assignable to type 'typeof Home'.
    Construct signature return types 'Vue<unknown, never[], {}>' and 'Home' are incompatible.
      The types of 'render' are incompatible between these types.
        Type '(() => void | VNode<RendererNode, RendererElement, { [key: string]: any; }>) | undefined' is not assignable to type '() => boolean'.
          Type 'undefined' is not assignable to type '() => boolean'.
    2 | import { Options, Vue } from "vue-class-component";
    3 |
  > 4 | @Options({})
      | ^^^^^^^^^^^^
    5 | export default class Home extends Vue {
    6 |   render(){
    7 |     return (

ERROR in src/views/Home.vue:4:2
TS2345: Argument of type 'typeof Home' is not assignable to parameter of type 'VueConstructor<Vue<unknown, never[], {}>>'.
  Types of property 'prototype' are incompatible.
    Type 'Home' is not assignable to type 'Vue<unknown, never[], {}>'.
      Type 'Home' is not assignable to type 'ClassComponentHooks'.
        The types returned by 'render()' are incompatible between these types.
          Type 'boolean' is not assignable to type 'void | VNode<RendererNode, RendererElement, { [key: string]: any; }>'.
    2 | import { Options, Vue } from "vue-class-component";
    3 |
  > 4 | @Options({})
      |  ^^^^^^^^^^^
    5 | export default class Home extends Vue {
    6 |   render(){
    7 |     return (

ERROR in src/views/Home.vue:6:3
TS2416: Property 'render' in type 'Home' is not assignable to the same property in base type 'Vue<unknown, {}, {}>'.
  Type '() => boolean' is not assignable to type '() => void | VNode<RendererNode, RendererElement, { [key: string]: any; }>'.
    Type 'boolean' is not assignable to type 'void | VNode<RendererNode, RendererElement, { [key: string]: any; }>'.
    4 | @Options({})
    5 | export default class Home extends Vue {
  > 6 |   render(){
      |   ^^^^^^
    7 |     return (
    8 |         <div>456</div>
    9 |     )

ERROR in src/views/Home.vue:8:10
TS2304: Cannot find name 'div'.
     6 |   render(){
     7 |     return (
  >  8 |         <div>456</div>
       |          ^^^
     9 |     )
    10 |   }
    11 | }

from babel-plugin-jsx.

Zcating avatar Zcating commented on July 19, 2024

The Vue3 will not support class API. Please use Composition-API.

from babel-plugin-jsx.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.