<uni-forms></uni-forms>
uniapp x 仅仅添加了上述代码就爆粗了
[HBuilder] 12:10:57.071 warning: Expected 4 arguments, but got 3.
[HBuilder] 12:10:57.072 at node_modules/@dcloudio/uni-ui/lib/uni-forms/uni-forms.vue:228:16
[HBuilder] 12:10:57.072 226 | */
[HBuilder] 12:10:57.072 227 | validate(keepitem, callback) {
[HBuilder] 12:10:57.072 > 228 | return this.checkAll(this.formData, keepitem, callback);
[HBuilder] 12:10:57.072 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
[HBuilder] 12:10:57.072 229 | },
[HBuilder] 12:10:57.072 230 |
[HBuilder] 12:10:57.072 231 | /**
[HBuilder] 12:10:57.073 warning: No overload matches this call.
[HBuilder] 12:10:57.073 Overload 1 of 2, '(searchElement: never, fromIndex?: number | undefined): number', gave the following error.
[HBuilder] 12:10:57.073 Argument of type 'any' is not assignable to parameter of type 'never'.
[HBuilder] 12:10:57.073 Overload 2 of 2, '(searchElement: never, fromIndex?: number | undefined): number', gave the following error.
[HBuilder] 12:10:57.073 at node_modules/@dcloudio/uni-ui/lib/uni-forms/uni-forms.vue:242:23
[HBuilder] 12:10:57.073 240 | this.childrens.forEach(item => {
[HBuilder] 12:10:57.073 241 | const name = realName(item.name)
[HBuilder] 12:10:57.073 > 242 | if (props.indexOf(name) !== -1) {
[HBuilder] 12:10:57.073 | ^^^^
[HBuilder] 12:10:57.074 243 | invalidFields = Object.assign({}, invalidFields, {
[HBuilder] 12:10:57.074 245 | });
[HBuilder] 12:10:57.074 warning: Expected 4 arguments, but got 3.
[HBuilder] 12:10:57.074 at node_modules/@dcloudio/uni-ui/lib/uni-forms/uni-forms.vue:248:16
[HBuilder] 12:10:57.074 246 | }
[HBuilder] 12:10:57.074 247 | });
[HBuilder] 12:10:57.074 > 248 | return this.checkAll(invalidFields, [], callback);
[HBuilder] 12:10:57.074 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
[HBuilder] 12:10:57.074 249 | },
[HBuilder] 12:10:57.075 250 |
[HBuilder] 12:10:57.075 251 | /**
[HBuilder] 12:10:57.075 warning: No overload matches this call.
[HBuilder] 12:10:57.075 Overload 1 of 2, '(searchElement: never, fromIndex?: number | undefined): number', gave the following error.
[HBuilder] 12:10:57.075 Argument of type 'any' is not assignable to parameter of type 'never'.
[HBuilder] 12:10:57.075 Overload 2 of 2, '(searchElement: never, fromIndex?: number | undefined): number', gave the following error.
[HBuilder] 12:10:57.075 at node_modules/@dcloudio/uni-ui/lib/uni-forms/uni-forms.vue:263:24
[HBuilder] 12:10:57.075 261 | } else {
[HBuilder] 12:10:57.075 262 | const name = realName(item.name)
[HBuilder] 12:10:57.075 > 263 | if (props.indexOf(name) !== -1) {
[HBuilder] 12:10:57.075 | ^^^^
[HBuilder] 12:10:57.076 264 | item.errMsg = '';
[HBuilder] 12:10:57.076 265 | }
[HBuilder] 12:10:57.076 266 | }
[HBuilder] 12:10:57.076 warning: No overload matches this call.
[HBuilder] 12:10:57.076 Overload 1 of 2, '(...items: never[]): number', gave the following error.
[HBuilder] 12:10:57.076 Argument of type 'any' is not assignable to parameter of type 'never'.
[HBuilder] 12:10:57.076 Overload 2 of 2, '(...items: never[]): number', gave the following error.
[HBuilder] 12:10:57.076 at node_modules/@dcloudio/uni-ui/lib/uni-forms/uni-forms.vue:303:21
[HBuilder] 12:10:57.076 301 | const item = this.childrens.find(v => realName(v.name) === i)
[HBuilder] 12:10:57.077 302 | if (item) {
[HBuilder] 12:10:57.077 > 303 | childrens.push(item)
[HBuilder] 12:10:57.077 | ^^^^
[HBuilder] 12:10:57.077 304 | }
[HBuilder] 12:10:57.077 305 | }
[HBuilder] 12:10:57.077 306 |
[HBuilder] 12:10:57.077 warning: Property 'name' does not exist on type 'never'.
[HBuilder] 12:10:57.077 at node_modules/@dcloudio/uni-ui/lib/uni-forms/uni-forms.vue:328:31
[HBuilder] 12:10:57.077 326 | for (let i in childrens) {
[HBuilder] 12:10:57.077 327 | const child = childrens[i]
[HBuilder] 12:10:57.077 > 328 | let name = realName(child.name);
[HBuilder] 12:10:57.078 | ^^^^
[HBuilder] 12:10:57.078 329 | const result = await child.onFieldChange(tempFormData[name]);
[HBuilder] 12:10:57.078 330 | if (result) {
[HBuilder] 12:10:57.078 331 | results.push(result);
[HBuilder] 12:10:57.078 warning: Property 'onFieldChange' does not exist on type 'never'.
[HBuilder] 12:10:57.078 at node_modules/@dcloudio/uni-ui/lib/uni-forms/uni-forms.vue:329:32
[HBuilder] 12:10:57.079 327 | const child = childrens[i]
[HBuilder] 12:10:57.079 328 | let name = realName(child.name);
[HBuilder] 12:10:57.079 > 329 | const result = await child.onFieldChange(tempFormData[name]);
[HBuilder] 12:10:57.079 | ^^^^^^^^^^^^^
[HBuilder] 12:10:57.079 330 | if (result) {
[HBuilder] 12:10:57.079 331 | results.push(result);
[HBuilder] 12:10:57.079 332 | // toast ,modal 只需要执行第一次就可以
[HBuilder] 12:10:57.079 warning: 'tempFormData' is possibly 'null'.
[HBuilder] 12:10:57.079 at node_modules/@dcloudio/uni-ui/lib/uni-forms/uni-forms.vue:329:46
[HBuilder] 12:10:57.079 327 | const child = childrens[i]
[HBuilder] 12:10:57.079 328 | let name = realName(child.name);
[HBuilder] 12:10:57.080 > 329 | const result = await child.onFieldChange(tempFormData[name]);
[HBuilder] 12:10:57.080 | ^^^^^^^^^^^^
[HBuilder] 12:10:57.080 330 | if (result) {
[HBuilder] 12:10:57.080 331 | results.push(result);
[HBuilder] 12:10:57.080 332 | // toast ,modal 只需要执行第一次就可以
[HBuilder] 12:10:57.080 warning: No overload matches this call.
[HBuilder] 12:10:57.080 Overload 1 of 2, '(...items: never[]): number', gave the following error.
[HBuilder] 12:10:57.080 Argument of type 'any' is not assignable to parameter of type 'never'.
[HBuilder] 12:10:57.080 Overload 2 of 2, '(...items: never[]): number', gave the following error.
[HBuilder] 12:10:57.080 at node_modules/@dcloudio/uni-ui/lib/uni-forms/uni-forms.vue:331:19
[HBuilder] 12:10:57.081 329 | const result = await child.onFieldChange(tempFormData[name]);
[HBuilder] 12:10:57.081 330 | if (result) {
[HBuilder] 12:10:57.081 > 331 | results.push(result);
[HBuilder] 12:10:57.081 | ^^^^^^
[HBuilder] 12:10:57.081 332 | // toast ,modal 只需要执行第一次就可以
[HBuilder] 12:10:57.081 333 | if (this.errShowType === 'toast' || this.errShowType === 'modal') break;
[HBuilder] 12:10:57.081 334 | }
[HBuilder] 12:10:57.081 warning: Type 'null' is not assignable to type 'never[]'.
[HBuilder] 12:10:57.081 at node_modules/@dcloudio/uni-ui/lib/uni-forms/uni-forms.vue:339:31
[HBuilder] 12:10:57.081 337 |
[HBuilder] 12:10:57.081 338 | if (Array.isArray(results)) {
[HBuilder] 12:10:57.081 > 339 | if (results.length === 0) results = null;
[HBuilder] 12:10:57.082 | ^^^^^^^
[HBuilder] 12:10:57.082 340 | }
[HBuilder] 12:10:57.082 341 | if (Array.isArray(keepitem)) {
[HBuilder] 12:10:57.082 342 | keepitem.forEach(v => {
[HBuilder] 12:10:57.082 warning: 'tempFormData' is possibly 'null'.
[HBuilder] 12:10:57.082 at node_modules/@dcloudio/uni-ui/lib/uni-forms/uni-forms.vue:346:7
[HBuilder] 12:10:57.082 344 | let value = getDataValue(v, this.localData)
[HBuilder] 12:10:57.082 345 | if (value !== undefined) {
[HBuilder] 12:10:57.082 > 346 | tempFormData[vName] = value
[HBuilder] 12:10:57.082 | ^^^^^^^^^^^^
[HBuilder] 12:10:57.082 347 | }
[HBuilder] 12:10:57.083 348 | });
[HBuilder] 12:10:57.083 349 | }
0 个回复