适配新框架的oakRender
This commit is contained in:
parent
eda031fac5
commit
b932763afd
|
|
@ -61,13 +61,7 @@ module.exports = (babel) => {
|
||||||
),
|
),
|
||||||
]),
|
]),
|
||||||
t.returnStatement(
|
t.returnStatement(
|
||||||
t.callExpression(
|
t.identifier('render')
|
||||||
t.memberExpression(
|
|
||||||
t.identifier('render'),
|
|
||||||
t.identifier('call')
|
|
||||||
),
|
|
||||||
[t.thisExpression()]
|
|
||||||
)
|
|
||||||
),
|
),
|
||||||
];
|
];
|
||||||
const renderJsStatements = [
|
const renderJsStatements = [
|
||||||
|
|
@ -83,13 +77,7 @@ module.exports = (babel) => {
|
||||||
),
|
),
|
||||||
]),
|
]),
|
||||||
t.returnStatement(
|
t.returnStatement(
|
||||||
t.callExpression(
|
t.identifier('render')
|
||||||
t.memberExpression(
|
|
||||||
t.identifier('render'),
|
|
||||||
t.identifier('call')
|
|
||||||
),
|
|
||||||
[t.thisExpression()]
|
|
||||||
)
|
|
||||||
),
|
),
|
||||||
];
|
];
|
||||||
const renderPcTsxStatements = [
|
const renderPcTsxStatements = [
|
||||||
|
|
@ -107,13 +95,7 @@ module.exports = (babel) => {
|
||||||
),
|
),
|
||||||
]),
|
]),
|
||||||
t.returnStatement(
|
t.returnStatement(
|
||||||
t.callExpression(
|
t.identifier('render')
|
||||||
t.memberExpression(
|
|
||||||
t.identifier('render'),
|
|
||||||
t.identifier('call')
|
|
||||||
),
|
|
||||||
[t.thisExpression()]
|
|
||||||
)
|
|
||||||
),
|
),
|
||||||
];
|
];
|
||||||
const renderPcJsStatements = [
|
const renderPcJsStatements = [
|
||||||
|
|
@ -129,13 +111,7 @@ module.exports = (babel) => {
|
||||||
),
|
),
|
||||||
]),
|
]),
|
||||||
t.returnStatement(
|
t.returnStatement(
|
||||||
t.callExpression(
|
t.identifier('render')
|
||||||
t.memberExpression(
|
|
||||||
t.identifier('render'),
|
|
||||||
t.identifier('call')
|
|
||||||
),
|
|
||||||
[t.thisExpression()]
|
|
||||||
)
|
|
||||||
),
|
),
|
||||||
];
|
];
|
||||||
const getStatements = () => {
|
const getStatements = () => {
|
||||||
|
|
@ -236,15 +212,13 @@ module.exports = (babel) => {
|
||||||
node2 &&
|
node2 &&
|
||||||
node2.declaration &&
|
node2.declaration &&
|
||||||
node2.declaration.callee &&
|
node2.declaration.callee &&
|
||||||
(node2.declaration.callee.name === 'OakPage' ||
|
node2.declaration.callee.name === 'OakComponent'
|
||||||
node2.declaration.callee.name ===
|
|
||||||
'OakComponent')
|
|
||||||
) {
|
) {
|
||||||
const statements = getStatements();
|
const statements = getStatements();
|
||||||
node2.declaration.arguments.forEach((node3) => {
|
node2.declaration.arguments.forEach((node3) => {
|
||||||
if (t.isObjectExpression(node3)) {
|
if (t.isObjectExpression(node3)) {
|
||||||
const propertyRender = t.objectProperty(
|
const propertyRender = t.objectProperty(
|
||||||
t.identifier('render'),
|
t.identifier('getRender'),
|
||||||
t.functionExpression(
|
t.functionExpression(
|
||||||
null,
|
null,
|
||||||
[],
|
[],
|
||||||
|
|
@ -261,16 +235,13 @@ module.exports = (babel) => {
|
||||||
node2 &&
|
node2 &&
|
||||||
node2.expression &&
|
node2.expression &&
|
||||||
node2.expression.right &&
|
node2.expression.right &&
|
||||||
node2.expression.right.callee &&
|
node2.expression.right.callee && node2.expression.right.callee.name === 'OakComponent'
|
||||||
(node2.expression.right.callee.name === 'OakPage' ||
|
|
||||||
node2.expression.right.callee.name ===
|
|
||||||
'OakComponent')
|
|
||||||
) {
|
) {
|
||||||
const statements = getStatements();
|
const statements = getStatements();
|
||||||
node2.expression.right.arguments.forEach((node3) => {
|
node2.expression.right.arguments.forEach((node3) => {
|
||||||
if (t.isObjectExpression(node3)) {
|
if (t.isObjectExpression(node3)) {
|
||||||
const propertyRender = t.objectProperty(
|
const propertyRender = t.objectProperty(
|
||||||
t.identifier('render'),
|
t.identifier('getRender'),
|
||||||
t.functionExpression(
|
t.functionExpression(
|
||||||
null,
|
null,
|
||||||
[],
|
[],
|
||||||
|
|
|
||||||
|
|
@ -99,7 +99,7 @@ module.exports = {
|
||||||
appRootPath: resolveRoot('.'),
|
appRootPath: resolveRoot('.'),
|
||||||
oakConfigJson: resolveApp('src/oak.config.json'),
|
oakConfigJson: resolveApp('src/oak.config.json'),
|
||||||
oakGeneralBusinessAppPath: resolveRoot(
|
oakGeneralBusinessAppPath: resolveRoot(
|
||||||
'node_modules/oak-general-business/lib'
|
'node_modules/oak-general-business/src'
|
||||||
),
|
),
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue