Skip to content

Commit

Permalink
fix: schemaForm props.value 变化了, jsf 没有处理的异常
Browse files Browse the repository at this point in the history
  • Loading branch information
苏文雄 committed Oct 31, 2019
1 parent 604188f commit 7f3004c
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 1 deletion.
File renamed without changes.
14 changes: 14 additions & 0 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ import ArraySchemaForm from './array-schema-form'
import {Button} from 'antd'
import './index.scss'
import getName from './locale'
import watchProps from './common/watchProps'

const Ajv = require('ajv');
const ajv = new Ajv();

Expand All @@ -31,6 +33,7 @@ function setData(state, keys, value) {

}

@watchProps
export default class JsonSchemaForm extends React.PureComponent {
constructor (props) {
super (props);
Expand Down Expand Up @@ -63,6 +66,17 @@ export default class JsonSchemaForm extends React.PureComponent {
locale: 'en_US'
};

watch = {
value: {
deep: false,
hander(v){
this.changeStore(store=>{
store.value = v
})
}
}
}

moveArrayItem =(paths, from, to)=>{

function arrMove(arr, fromIndex, toIndex) {
Expand Down
2 changes: 1 addition & 1 deletion src/widgets/input/index.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import {Input} from 'antd';
import React, {Component} from 'react';
import PropTypes from 'prop-types';
import watchProps from './watchProps';
import watchProps from '../../common/watchProps';

@watchProps
export default class InputBlurSearchComponent extends Component {
Expand Down

0 comments on commit 7f3004c

Please sign in to comment.