dynamicformdjx 0.3.1 → 0.3.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -84,7 +84,7 @@ pnpm add dynamicformdjx
84
84
  const useForm = useDyForm<FormRow>(formItems)
85
85
  const getData = () => {
86
86
  // const res=useForm.getValues() // 或
87
- const res = naiDynamicFormRef.value?.getResult()
87
+ const res = naiDynamicFormRef.value?.getResult?.()
88
88
  console.log(res)
89
89
  }
90
90
  const resetData = () => {
@@ -104,7 +104,7 @@ pnpm add dynamicformdjx
104
104
  }
105
105
  const validatorData = () => {
106
106
  // 校验
107
- naiDynamicFormRef.value.validator().then(data => {
107
+ naiDynamicFormRef.value?.validator().then(data => {
108
108
  console.log(data)
109
109
  }).catch(err => {
110
110
  console.log(err)
@@ -173,6 +173,7 @@ const formItems = useReactiveForm<FormRow, FormRules | FormItemRule>([
173
173
  clearable: true,
174
174
  placeholder: '请输入姓名',
175
175
  required: true,
176
+ // @ts-ignore
176
177
  render2: f => h(NInput, {
177
178
  ...f,
178
179
  value: f.value.value, "onUpdate:value"(v) {
@@ -222,21 +223,21 @@ const getData = () => {
222
223
  }
223
224
  const resetData = () => {
224
225
  useForm.onReset()
225
- naiDynamicInputRef.value?.onSet({})
226
+ naiDynamicInputRef.value?.onSet?.({})
226
227
  }
227
228
  const setData = () => {
228
229
  useForm.setValues({
229
230
  name: 'naive-ui',
230
231
  desc:`A Vue 3 Component Library Fairly Complete, Theme Customizable, Uses TypeScript, Fast Kinda Interesting`
231
232
  })
232
- naiDynamicInputRef.value?.onSet({
233
+ naiDynamicInputRef.value?.onSet?.({
233
234
  question: 'how are you?',
234
235
  answer: "I'm fine,Thank you"
235
236
  })
236
237
  }
237
238
  const validatorData = () => {
238
239
  // 校验
239
- naiDynamicFormRef.value.validator().then(data => {
240
+ naiDynamicFormRef.value?.validator().then(data => {
240
241
  console.log(data)
241
242
  }).catch(err => {
242
243
  console.log(err)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dynamicformdjx",
3
- "version": "0.3.1",
3
+ "version": "0.3.2",
4
4
  "type": "module",
5
5
  "author": "xczcdjx",
6
6
  "license": "MIT",