mirror of
https://github.com/youzan/vant.git
synced 2025-10-22 11:54:02 +00:00
[improvement] functional inherit context (#2716)
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
import { use, noop } from '../utils';
|
||||
import { inheritContext } from '../utils/functional';
|
||||
import Icon from '../icon';
|
||||
|
||||
const [sfc, bem] = use('nav-bar');
|
||||
@@ -22,7 +23,7 @@ export default sfc({
|
||||
}
|
||||
},
|
||||
|
||||
render(h, context, inherit) {
|
||||
render(h, context) {
|
||||
const { props, listeners } = context;
|
||||
const slots = context.slots();
|
||||
|
||||
@@ -30,7 +31,7 @@ export default sfc({
|
||||
<div
|
||||
class={[bem({ fixed: props.fixed }), { 'van-hairline--bottom': props.border }]}
|
||||
style={{ zIndex: props.zIndex }}
|
||||
{...inherit}
|
||||
{...inheritContext(context)}
|
||||
>
|
||||
<div class={bem('left')} onClick={listeners['click-left'] || noop}>
|
||||
{slots.left || [
|
||||
|
Reference in New Issue
Block a user