【备忘录】Vue2.0组件props
export default { props: ['options'], data() { return { } } }
提示:[Vue warn]: Avoid mutating a prop directly since the value will be overwritten whenever the parent component re-renders. Instead, use a data or computed property based on the prop's value. Prop being mutated: "options" (found in component )
需要改为:
export default { props: ['myOptions'], data() { return { options: this.myOptions } } }
来调用options