Appearance
vue/define-props-declaration
强制声明样式
defineProps¥enforce declaration style of
defineProps
📖 规则详情
此规则强制执行 defineProps 键入样式,你应该使用 type-based 或 runtime 声明。
¥This rule enforces defineProps typing style which you should use type-based or runtime declaration.
此规则仅适用于安装脚本和 lang="ts"。
¥This rule only works in setup script and lang="ts".
🔧选项
¥🔧 Options
json
"vue/define-props-declaration": ["error", "type-based" | "runtime"]type-based(默认)强制基于类型的声明¥
type-based(default) enforces type-based declarationruntime强制执行运行时声明¥
runtimeenforces runtime declaration
"runtime"
👫相关规则
¥👫 Related Rules
📚扩展阅读
¥📚 Further Reading
🚀版本
¥🚀 Version
此规则是在 eslint-plugin-vue v9.5.0 中引入的
¥This rule was introduced in eslint-plugin-vue v9.5.0
🔍代码实现
¥🔍 Implementation