docs: add information about the optimize option

closes #48
This commit is contained in:
Haoqun Jiang
2025-02-09 02:36:21 +08:00
parent f84b81afac
commit 02f5fec0a0
2 changed files with 6 additions and 2 deletions

View File

@@ -41,7 +41,9 @@ Type: `boolean`
Default: `false`
是否开启优化. 如果你对 Vue 3 不太熟悉,不建议打开
开启此选项后JSX 插件会尝试使用 [`PatchFlags`](https://cn.vuejs.org/guide/extras/rendering-mechanism#patch-flags) 和 [`SlotFlags`](https://github.com/vuejs/core/blob/v3.5.13/packages/runtime-core/src/componentSlots.ts#L69-L77) 来优化运行时代码从而提升渲染性能。需要注意的是JSX 的灵活性远高于模板语法,这使得编译优化的可能性相对有限,其优化效果会比 Vue 官方模板编译器更为有限。
优化后的代码会选择性地跳过一些重渲染操作以提高性能。因此,建议在开启此选项后对应用进行完整的测试,确保所有功能都能正常工作。
#### isCustomElement