We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Chrome Custom Formatter 允许开发者自定义 JavaScript 对象在 Chrome DevTools Console 中的展示方式。
formatter包含三个方法:
function formatVueObject(obj) { // 编写你的自定义格式化逻辑,使对象更易读 // 例如,你可以提取关键信息或按照特定规则格式化输出 return formattedObject; } const formatter = { header: (obj) => { // 判断对象是否是 Vue 对象,是则应用自定义格式化 if (obj.__v_isRef || obj.__v_isReactive || obj.__v_isReadonly) { return ['div', {}, formatVueObject(obj)]; } // 返回 undefined 表示不应用自定义格式化 return undefined; }, }; if(window.devtoolsFormatters instanceof Array){ window.devtoolsFormatters.push(formatter); }else{ window.devtoolsFormatters = [formatter]; }
参考文章:
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Chrome Custom Formatter 允许开发者自定义 JavaScript 对象在 Chrome DevTools Console 中的展示方式。
首先要开启Custom Formatter
编写自定义格式化函数
formatter包含三个方法:
参考文章:
The text was updated successfully, but these errors were encountered: