Skip to content

Conversation

@myafer
Copy link

@myafer myafer commented Aug 26, 2024

从 Vue 3.4 开始,Vue 不再隐式注册全局 JSX 命名空间。要指示 TypeScript 使用 Vue 的 JSX 类型定义,需要加入:{
"compilerOptions": {
"jsxImportSource": "vue",
"jsx": "preserve",
}
}

Types of changes

  • New feature
  • Bug fix
  • Documentation change
  • Coding style change
  • Refactoring
  • Performance improvement
  • Test cases
  • Continuous integration
  • Typescript definition change
  • Breaking change

Background and context

从 Vue 3.4 开始,Vue 不再隐式注册全局 JSX 命名空间。要指示 TypeScript 使用 Vue 的 JSX 类型定义,请确保在你的 tsconfig.json 中包含以下内容:
{
"compilerOptions": {
"jsxImportSource": "vue",
"jsx": "preserve",
}
}

#362

Solution

显式添加"jsxImportSource": "vue",

How is the change tested?

Changelog

Changelog(CN) Changelog(EN) Related issues

Checklist:

  • Provide changelog for relevant changes (e.g. bug fixes and new features) if applicable.
  • Changes are submitted to the appropriate branch (e.g. features should be submitted to feature branch and others should be submitted to master branch)

Other information

从 Vue 3.4 开始,Vue 不再隐式注册全局 JSX 命名空间。要指示 TypeScript 使用 Vue 的 JSX 类型定义,需要加入:{
	"compilerOptions": {
		"jsxImportSource": "vue",
		"jsx": "preserve",
	}
}
Copy link

@Aganivi Aganivi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

great!

@javagossip
Copy link

great!
字节开源团队不给力啊,为啥不merge

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants