fix: 🐛 小程序里面不支持可选链 "?.", 先直接访问 dataSourceEngine 吧

This commit is contained in:
牧毅 2020-08-12 16:52:26 +08:00
parent eba172ce51
commit 36c486b9cd
2 changed files with 6 additions and 8 deletions

View File

@ -11,7 +11,7 @@ import { RAX_CHUNK_NAME } from './const';
type PluginConfig = {
fileType: string;
}
};
const pluginFactory: BuilderComponentPluginFactory<PluginConfig> = (config?) => {
const cfg: PluginConfig = {
@ -50,10 +50,10 @@ const pluginFactory: BuilderComponentPluginFactory<PluginConfig> = (config?) =>
self.setState(newState);
},
get dataSourceMap() {
return self._dataSourceEngine?.dataSourceMap || {};
return self._dataSourceEngine.dataSourceMap || {};
},
async reloadDataSource() {
self._dataSourceEngine?.reloadDataSource();
self._dataSourceEngine.reloadDataSource();
},
get utils() {
return self._utils;
@ -72,9 +72,7 @@ const pluginFactory: BuilderComponentPluginFactory<PluginConfig> = (config?) =>
return context;
}
`,
linkAfter: [
RAX_CHUNK_NAME.ClassRenderEnd
],
linkAfter: [RAX_CHUNK_NAME.ClassRenderEnd],
});
return next;

View File

@ -39,10 +39,10 @@ class Home$$Page extends Component {
self.setState(newState);
},
get dataSourceMap() {
return self._dataSourceEngine?.dataSourceMap || {};
return self._dataSourceEngine.dataSourceMap || {};
},
async reloadDataSource() {
self._dataSourceEngine?.reloadDataSource();
self._dataSourceEngine.reloadDataSource();
},
get utils() {
return self._utils;