(config: TPageMeta)
| 107 | } |
| 108 | |
| 109 | const parsePageOrComp = (config: TPageMeta) => { |
| 110 | if (!isPureComp(config)) { |
| 111 | config.entryOption = {} |
| 112 | } |
| 113 | config.modifyPageImport = function (this: PageParser, importStr: string[], page: TPageMeta | TPageMeta[]) { |
| 114 | function fixPageEntry (meta: TPageMeta) { |
| 115 | Object.assign(config.entryOption, { |
| 116 | routeName: meta.name, |
| 117 | }) |
| 118 | if (isObject(meta.config?.entryOption)) { |
| 119 | Object.assign(config.entryOption, meta.config.entryOption) |
| 120 | } |
| 121 | } |
| 122 | |
| 123 | if (!isPureComp(page)) { |
| 124 | if (page instanceof Array) { |
| 125 | page.forEach(fixPageEntry) |
| 126 | } else { |
| 127 | fixPageEntry(page) |
| 128 | } |
| 129 | } |
| 130 | |
| 131 | importStr.unshift('import { navigateBack } from "@tarojs/taro"') |
| 132 | importStr.unshift('import oh_window from "@ohos.window"') |
| 133 | importStr.unshift('import { TaroXComponent } from "@tarojs/components"') |
| 134 | importStr.unshift('import { TaroNativeModule, initStyleSheetConfig, systemContext, WINDOW_STATE } from "@tarojs/runtime"') |
| 135 | importStr.unshift('import { NodeContent } from "@ohos.arkui.node"') |
| 136 | importStr.unshift('import display from "@ohos.display"') |
| 137 | importStr.unshift('import { audio } from "@kit.AudioKit"') |
| 138 | } |
| 139 | |
| 140 | config.modifyRenderState = function (this: PageParser, state: (string | null)[], page: TPageMeta | TPageMeta[]) { |
| 141 | const isPure = isPureComp(page) |
| 142 | state.push( |
| 143 | this.renderState( |
| 144 | { |
| 145 | name: '__layoutSize', |
| 146 | type: 'TaroAny', |
| 147 | foreach: () => 'null', |
| 148 | disabled: !this.buildConfig.isBuildNativeComp && isPure, |
| 149 | }, |
| 150 | false |
| 151 | ), |
| 152 | this.renderState( |
| 153 | { |
| 154 | name: 'areaChange', |
| 155 | type: 'TaroAny', |
| 156 | foreach: () => 'null', |
| 157 | }, |
| 158 | false |
| 159 | ), |
| 160 | this.renderState( |
| 161 | { |
| 162 | name: '__pageName', |
| 163 | type: 'TaroAny', |
| 164 | foreach: () => 'null', |
| 165 | disabled: !this.buildConfig.isBuildNativeComp && isPure, |
| 166 | }, |
nothing calls this directly
no test coverage detected