赞
踩
sqlFormatter
sql-formatter - npm (npmjs.com)
- const sqlFormatter = require('@/utils/sqlFormatter')
-
-
-
-
- let sql = `select count(1) as cnt from t_user where id < 7`;
-
- // 格式化
- // let sqlF = sqlFormatter.format(sql);
- let sqlF = sqlFormatter.format(sql, {
- language:'mysql',
- });
-
-
- /**
- * indent: " ",
- * uppercase:false,
- * linesBetweenQueries: 2
- */
- console.log(sqlF)
增加样式
- <style>
- /* 设置 white-space 样式 */
- pre {
- white-space: pre-wrap;
- }
- </style>
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。