介绍

格式化输出内容,便于展示内容

下载地址

github: https://github.com/2460392754/uniapp-tools/tree/master/formatToJSON
dcloud: https://ext.dcloud.net.cn/plugin?id=798

更新日志

https://ext.dcloud.net.cn/plugin?id=798&update_log

兼容性测试

✅微信小程序
✅h5
✅android
❓其他平台(没测试)

效果图

TIM截图20190923144810.png

如何使用

  1. <template>
  2. <view>
  3. <print-json :value="data"></print-json>
  4. </view>
  5. </template>
  6. <script>
  7. import PrintJson from '../../components/formatToJSON/printJSON';
  8. export default {
  9. data () {
  10. return {
  11. data: {
  12. isNumber: 123,
  13. isString: 'xxx',
  14. isBoolean: false,
  15. isNull: null,
  16. isUndefined: undefined,
  17. isArray: ['a', 'b', ['c']],
  18. isObject: {
  19. a: 'is a',
  20. b: 'is b',
  21. c: {
  22. c1: 'is c1'
  23. }
  24. }
  25. }
  26. }
  27. },
  28. components: {
  29. PrintJson
  30. }
  31. }
  32. </script>

最后

出现bug了?
遇到无法解决的问题?
直接加我q或者发邮件也行

email: 2460392754@qq.com
qq: 2460392754

欢迎交流或探讨问题!