From b6d240b1bffd6672df699f15acf8ce8fed7acbbf Mon Sep 17 00:00:00 2001 From: fxy060608 Date: Mon, 22 Apr 2019 18:26:51 +0800 Subject: [PATCH] fix(h5): uni://form-field --- src/core/view/plugins/behaviors/form-field.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/core/view/plugins/behaviors/form-field.js b/src/core/view/plugins/behaviors/form-field.js index 56548ab86..b0ef9f3c5 100644 --- a/src/core/view/plugins/behaviors/form-field.js +++ b/src/core/view/plugins/behaviors/form-field.js @@ -27,9 +27,13 @@ export default { name: 'uni://form-field', init (options, vm) { if ( - !vm.constructor.options.props.name || + !vm.constructor.options.props || + !vm.constructor.options.props.name || !vm.constructor.options.props.value ) { // 未初始化 props + if (!vm.constructor.options.props) { + vm.constructor.options.props = {} + } if (!vm.constructor.options.props.name) { vm.constructor.options.props.name = options.props.name = { type: String -- GitLab