请参考以下示例:
https://jss.sitecore.com/docs/techniques/mvc-integration/client-side-embedding
该组件无法渲染,并且出现错误: [对象错误]:{说明:“无法获取未定义或空引用的属性'sitecore'”,消息:“无法获取未定义或空引用的属性'sitecore'”,编号:-2146823281,堆栈:“ TypeError:无法获得值为
的未定义或空引用的属性“ sitecore”(http://demo.local/dist/EmbeddedWizard/client.bundle.js:1:3845)在l
(http://demo.local/dist/EmbeddedWizard/vendor-client.bundle.js:1:111109)在beginWork
(http://demo.local/dist/EmbeddedWizard/vendor-client.bundle.js:1:119151)在
(http://demo.local/dist/EmbeddedWizard/vendor-client.bundle.js:1:123093)在
(http://demo.local/dist/EmbeddedWizard/vendor-client.bundle.js:1:123375)在G
(http://demo.local/dist/EmbeddedWizard/vendor-client.bundle.js:1:126125)在x
(http://demo.local/dist/EmbeddedWizard/vendor-client.bundle.js:1:125866)在n
(http://demo.local/dist/EmbeddedWizard/vendor-client.bundle.js:1:125703)在B
(http://demo.local/dist/EmbeddedWizard/vendor-client.bundle.js:1:125042)在v
({http://demo.local/dist/EmbeddedWizard/vendor-client.bundle.js:1:124506)“}
在线:
App route = {this.props.initialState.sitecore.route}
在\ sitecore-embedded-jss-app \ src \ boot \ Root.js文件中。