Skip to content

Commit

Permalink
fix(components): 修复 Vue2 组件的 nativeProps 失效的问题,fix #10689
Browse files Browse the repository at this point in the history
  • Loading branch information
Chen-jj committed Nov 22, 2021
1 parent 2f48e95 commit c721f26
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
4 changes: 4 additions & 0 deletions packages/taro-components/h5/vue/createComponent.js
Expand Up @@ -5,9 +5,13 @@ export default function createComponent (name, classNames = []) {
return {
name,
mixins: [listeners, refs],
props: ['nativeProps'],
render (createElement) {
return createElement(`${name}-core`, {
class: ['hydrated', ...classNames],
domProps: {
nativeProps: this.nativeProps
},
on: this.listeners
}, this.$slots.default)
}
Expand Down
9 changes: 8 additions & 1 deletion packages/taro-components/h5/vue/createFormsComponent.js
@@ -1,7 +1,11 @@
import { listeners } from './mixins/listeners'
import { refs } from './mixins/refs'
export default function createFormsComponent (name, event, modelValue = 'value', classNames = []) {
const props = {}
const props = {
nativeProps: {
type: Object
}
}
if (name === 'taro-input') {
props.focus = Boolean
}
Expand Down Expand Up @@ -38,6 +42,9 @@ export default function createFormsComponent (name, event, modelValue = 'value',

return createElement(`${name}-core`, {
class: ['hydrated', ...classNames],
domProps: {
nativeProps: this.nativeProps
},
attrs,
on
}, self.$slots.default)
Expand Down

0 comments on commit c721f26

Please sign in to comment.