Skip to content

Commit f502634

Browse files
committed
Fix example
1 parent 0632025 commit f502634

File tree

1 file changed

+6
-2
lines changed
  • packages/examples/src/examples

1 file changed

+6
-2
lines changed

packages/examples/src/examples/rule.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
2323
THE SOFTWARE.
2424
*/
25+
import { ValidateFunctionContext } from '@jsonforms/core';
2526
import { registerExamples } from '../register';
2627

2728
export const schema = {
@@ -113,8 +114,11 @@ export const uischema = {
113114
effect: 'SHOW',
114115
condition: {
115116
scope: '#',
116-
validate: (data: any) => {
117-
return !data.dead && data.kindOfVegetables !== 'All';
117+
validate: (context: ValidateFunctionContext) => {
118+
return (
119+
!(context.data as any).dead &&
120+
(context.data as any).kindOfVegetables !== 'All'
121+
);
118122
},
119123
},
120124
},

0 commit comments

Comments
 (0)