We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
vue hoc那边$slots里面的vnode是数组不是对象
.map(vnode => { vnode.context = this._self return vnode })
vnode是一个数组,改为⬇️
.map(vnodes => { vnodes.forEach(vnode => (vnode.context = this._self)); return vnodes })
The text was updated successfully, but these errors were encountered:
//成功代码
import * as R from "ramda"; //重载vnodes的方式 const how2ReloadVnodes = that => R.compose(R.forEach(vnode => (vnode.context = that._self))); //用xxxxx组合slots const composeSlotsWith = how => fromWho => R.compose(R.map(how(fromWho)), R.values); export const WithConsole = something => WrappedComponent => { return { mounted() { console.log(`I have already ${something}`); }, props: WrappedComponent.props, render(createElement) { const { $slots, $listeners, $props, $scopedSlots, $attrs } = this; const slots = composeSlotsWith(how2ReloadVnodes)(this)($slots); // 什么是vue的 h(createElement)函数 见 https://segmentfault.com/a/1190000020526322*/ return createElement( WrappedComponent, { on: $listeners, props: $props, scopedSlots: $scopedSlots, attrs: $attrs, }, slots ); }, }; };
Sorry, something went wrong.
No branches or pull requests
vue hoc那边$slots里面的vnode是数组不是对象
vnode是一个数组,改为⬇️
The text was updated successfully, but these errors were encountered: