Skip to content

vue/no-export-in-script-setup

禁止 <script setup> 中的 export

  • ⚙️ 此规则包含在 "plugin:vue/essential"*.configs["flat/essential"]"plugin:vue/vue2-essential"*.configs["flat/vue2-essential"]"plugin:vue/strongly-recommended"*.configs["flat/strongly-recommended"]"plugin:vue/vue2-strongly-recommended"*.configs["flat/vue2-strongly-recommended"]"plugin:vue/recommended"*.configs["flat/recommended"]"plugin:vue/vue2-recommended"*.configs["flat/vue2-recommended"] 中。

📖 规则详情

此规则警告 <script setup> 中的 ES 模块导出。

¥This rule warns ES module exports in <script setup>.

以前版本的 <script setup> RFC 使用 export 定义模板中使用的变量,但新的 <script setup> RFC 已更新为不使用 export 进行定义。有关更多详细信息,请参阅 Vue RFC - 0040-script-setup

¥The previous version of <script setup> RFC used export to define variables used in templates, but the new <script setup> RFC has been updated to define without using export. See Vue RFCs - 0040-script-setup for more details.

Now loading...
Now loading...

🔧选项

¥🔧 Options

无。

¥Nothing.

📚扩展阅读

¥📚 Further Reading

🚀版本

¥🚀 Version

此规则在 eslint-plugin-vue v7.13.0 中引入

¥This rule was introduced in eslint-plugin-vue v7.13.0

🔍代码实现

¥🔍 Implementation

eslint-plugin-vue v10.0 中文网 - 粤ICP备13048890号