模板做了小部分修改,使用keyof EntityDict代替虚拟组件中的user

This commit is contained in:
Pan Qiancheng 2025-03-19 18:17:36 +08:00
parent 824bad6335
commit 948f8e7be4
8 changed files with 8564 additions and 6 deletions

8537
package-lock.json generated Normal file

File diff suppressed because it is too large Load Diff

View File

@ -1,3 +1,5 @@
export default function Render() {
import React from "react";
export default function {{componentName}}() {
return (<> </>);
}

View File

@ -1,3 +1,5 @@
export default function Render() {
import React from "react";
export default function {{componentName}}() {
return (<> </>);
}

View File

@ -1,3 +1,5 @@
export default function Render() {
import React from "react";
export default function {{componentName}}() {
return (<> </>);
}

View File

@ -6,7 +6,11 @@ import Styles from './styles.module.less';
const {{componentName}} = (
props: WebComponentProps<
EntityDict,
{{#if isVirtual}}
keyof EntityDict,
{{else}}
'{{entityName}}',
{{/if}}
{{isList}},
{
{{#if isVirtual}}

View File

@ -6,7 +6,11 @@ import Styles from './styles.module.less';
const {{componentName}} = (
props: WebComponentProps<
EntityDict,
{{#if isVirtual}}
keyof EntityDict,
{{else}}
'{{entityName}}',
{{/if}}
{{isList}},
{
{{#if isVirtual}}

View File

@ -45,6 +45,7 @@ export type CreateOakComponent = {
localeZhCN: LocaleTemplate;
styleLess: StyleLessTemplate;
indexXml: IndexXmlTemplate;
nativeRender: ComponentTemplate;
};
type Language = 'zh_CN' | 'en_US';

View File

@ -95,6 +95,12 @@ export const generateTemplate = (
entityName: realConfig.entityName,
isList: realConfig.isList,
},
nativeRender: {
isVirtual: realConfig.isVirtual,
componentName,
entityName: realConfig.entityName,
isList: realConfig.isList,
},
localeZhCN: {},
styleLess: {},
indexXml: {
@ -111,11 +117,11 @@ export const generateTemplate = (
realConfig.renderFile.includes('index.xml') &&
outputTemplate('indexLess', {}, outPath);
realConfig.renderFile.includes('render.native.tsx') &&
outputTemplate('renderNativeTsx', {}, outPath);
outputTemplate('renderNativeTsx', data.nativeRender, outPath);
realConfig.renderFile.includes('render.ios.tsx') &&
outputTemplate('renderIosTsx', {}, outPath);
outputTemplate('renderIosTsx', data.nativeRender, outPath);
realConfig.renderFile.includes('render.android.tsx') &&
outputTemplate('renderAndroidTsx', {}, outPath);
outputTemplate('renderAndroidTsx', data.nativeRender, outPath);
// index.json
realConfig.renderFile.includes('index.xml') &&