You're Invited:Meet the Socket Team at RSAC and BSidesSF 2026, March 23–26.RSVP
Socket
Book a DemoSign in
Socket

vue-json-diff-fehelper9

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install
Package was removed
Sorry, it seems this package was removed from the registry

vue-json-diff-fehelper9

A json diff vue component

unpublished
latest
Source
npmnpm
Version
9.0.0
Version published
Weekly downloads
0
Maintainers
1
Weekly downloads
 
Created
Source

vue-json-diff-fehelper

基于Fehelper里的jsondiff功能封装的vue组件。

推荐浏览器插件:FeHelper--Web前端助手(https://github.com/zxlie/FeHelper)

Usage

安装vue-fehelper-json-diff包,依赖vue

npm install vue-json-diff-fehelper
or
yarn add vue-json-diff-fehelper

vue调用

<template>
  <div id="app">
    <json-diff :jsonSourceLeft="leftData" :jsonSourceRight="rightData" />
  </div>
</template>

<script>
import JsonDiff from 'vue-json-diff-fehelper'
export default {
  components: {
    JsonDiff
  },
  data() {
    return {
      leftData: {
        "data": {
            "needQueryPosition": 0,
            "orderStatus": "已取消",
            "orderTrace": {
                "timeLine": [
                    {
                        "date": "10/13",
                        "time": "18:26",
                        "status": "订单已取消"
                    },
                    {
                        "date": "10/13",
                        "time": "18:11",
                        "status": "订单提交成功"
                    }
                ],
                "lastStatusDesc": "订单未支付,已自动取消"
            }
          
        },
        "code": 0,
        "msg": "",
        "success": true
      },
      rightData: {
          "data": {
              "needQueryPosition1": 0,
              "orderStatus": "已取消",
              "orderTrace1": {
                  "timeLine": [
                      {
                          "date": "10/13",
                          "time": "18:26",
                          "status": "订单已取消"
                      },
                      {
                          "date": "10/13",
                          "time": "18:11",
                          "status": "订单提交成功"
                      }
                  ],
                  "lastStatusDesc": "订单未支付,已自动取消"
              }
            
          },
          "code": 1,
          "msg": "2222",
          "success": true
      }
    }
  }
}
</script>

props

属性类型描述
jsonSourceLeftObject/String左侧区域展示数据
jsonSourceRightObject/String右侧区域展示数据
showHeadingBoolean是否显示顶部对比结果
errorHandlerFunction错误处理回调方法
diffHandlerFunction对比结果回调方法
resultObject对比结果 this.$refs.ref[0].result => { inputText: inputText, which: this.which, diffs: diffs}

Keywords

json

FAQs

Package last updated on 25 Mar 2022

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts