vue组件引用json数据
vue-json-比较 (vue-json-compare)
vue(2.x) json compare components.
vue(2.x)json比较组件。
安装 (Install)
npm install --save vue-json-compare
用法 (Usage)
<template>
<div>
<vue-json-compare :oldData="oldData" :newData="newData"></vue-json-compare>
</div>
</template>
import vueJsonCompare from 'vue-json-compare'
export default {
components: {
vueJsonCompare
},
data () {
return {
oldData: {
a: 1,
e: 0
},
newData: {
a: 2
b: 3
}
}
}
}
道具 (Props)
Attribute | Level | Description | Type | Default |
---|---|---|---|---|
oldData | basic | json data | JSON object or object Array, {...}, [{...}, {...}] | - |
newData | basic | json data | JSON object or object Array, {...}, [{...}, {...}] | - |
属性 | 水平 | 描述 | 类型 | 默认 |
---|---|---|---|---|
oldData | 基本的 | json数据 | JSON对象或对象数组,{...},[{...},{...}] | -- |
新数据 | 基本的 | json数据 | JSON对象或对象数组,{...},[{...},{...}] | -- |
翻译自: https://vuejsexamples.com/a-vue-components-for-compare-json-data/
vue组件引用json数据