[improvement] functional inherit context (#2716)

This commit is contained in:
neverland
2019-02-11 20:46:46 +08:00
committed by GitHub
parent 9947ab00e8
commit 0bf4a9e799
9 changed files with 104 additions and 85 deletions
+3 -2
View File
@@ -1,4 +1,5 @@
import { use } from '../utils';
import { inheritContext } from '../utils/functional';
import Cell from '../cell';
const [sfc, bem, t] = use('contact-card');
@@ -20,7 +21,7 @@ export default sfc({
}
},
render(h, context, inherit) {
render(h, context) {
const { props, listeners } = context;
const { type, editable } = props;
@@ -37,7 +38,7 @@ export default sfc({
listeners.click(event);
}
}}
{...inherit}
{...inheritContext(context)}
>
{type === 'add'
? props.addText || t('addText')