babel-plugin-transform-vue-jsx icon indicating copy to clipboard operation
babel-plugin-transform-vue-jsx copied to clipboard

Props spread is not reactive

Open minuukang opened this issue 7 years ago • 2 comments

export default {
  render () {
   return <component-item model={this.model} {...this.itemProps} />
  },
  props: {
    ...componentItemProps
  },
  computed: {
    itemProps: {
      const keys = Object.keys(componentItemProps) // componentItemProps: is props object
        return intersection(Object.keys(this.$props), keys).reduce((result, key) => {
          result[key] = this.$props[key]
          return result
        }, {})
    }
  }
}

i want to use itemProps computed value the prop spread syntax. but the spread syntax prop is not reactable(itemProps is fixed first value in render.). may i use wrong way or its bug?

minuukang avatar Dec 26 '17 02:12 minuukang

Spread should be reactive just like everything else. Can you please provide a reproduction link so I can debug it?

nickmessing avatar Jan 14 '18 15:01 nickmessing

Thanks that reply

https://github.com/MinuKang/vuejs-jsx-props-spread-reactive

Here the questions code.

I want to pass props <component-list> to <component-item>. But spread props syntax is not pass.

minuukang avatar Jan 15 '18 09:01 minuukang