diff --git a/packages/ncform-e2e/ncform/cypress/integration/examples/others.spec.js b/packages/ncform-e2e/ncform/cypress/integration/examples/others.spec.js index 9d6e5ea..1125035 100644 --- a/packages/ncform-e2e/ncform/cypress/integration/examples/others.spec.js +++ b/packages/ncform-e2e/ncform/cypress/integration/examples/others.spec.js @@ -87,4 +87,11 @@ context('Others', () => { }) }) + it('$ncformGetValue api', () => { + cy.window().then(win => { + let formName = 'form_' + md5('$ncformGetValue api'); + expect(win.Vue.prototype.$ncformGetValue(formName)).to.deep.equal({"showField":"1","obj":{"show":"1"},"arr":[{"show":"1"}]}); + }) + }) + }) diff --git a/packages/ncform/examples/components/vue-ncform/_others.html b/packages/ncform/examples/components/vue-ncform/_others.html index 45f51e7..d2ebcce 100644 --- a/packages/ncform/examples/components/vue-ncform/_others.html +++ b/packages/ncform/examples/components/vue-ncform/_others.html @@ -182,12 +182,13 @@ { id: md5('$ncformGetValue api'), title: '$ncformGetValue api', - formName: 'form_' + Math.random(), + formName: 'form_' + md5('$ncformGetValue api'), formSchema: { type: 'object', properties: { showField: { type: 'string', + value: '1' }, hiddenField: { type: 'string', @@ -199,7 +200,8 @@ type: 'object', properties: { show: { - type: 'string' + type: 'string', + value: '1' }, hide: { type: 'string', @@ -215,7 +217,8 @@ type: 'object', properties: { show: { - type: 'string' + type: 'string', + value: '1' }, hide: { type: 'string', @@ -224,7 +227,8 @@ }, } } - } + }, + value: [{show: '1', hidden: ''}] } }, globalConfig: {