Open yuanjinyong opened 4 months ago
抱歉,最近没有时间来更新这个插件,您可以临时这样实现来保留缩进(运行时):
<pre>{{ JSON.stringify({...}, null, 2) }}</pre>
通过JSON.stringify的方式,没法保留行尾的注释说明,这个本意是想通过样例说明讲解传达如何使用属性。
我现在临时通过 PreprocessorDirectives({include: /src\/common\/plugins\/./}) 的方式,仅包含极个别使用了条件宏定义的源码文件来规避过去。
In Vue SFC file, with the following code
And in vite.config.ts file, use this plugin
I want to keep the whitespace in pre tag content for indentation display, if use PreprocessorDirectives plugin, the indentation lost.
I used following versions: "vue": "^3.4.24", "@vitejs/plugin-vue": "^5.0.4", "unplugin-preprocessor-directives": "^1.0.3", "vite": "^5.2.10",