不支持组件中使用 self 引用自身
Closed this issue · 2 comments
Sheetaa commented
我看san文档上有 self 这种使用方法的。如下:
var Node = san.defineComponent({
// template
components: {
'ui-node': 'self'
}
});
不过使用 san-ssr 编译会报错:
Error: Expected to find an initializer of kind 'Identifier'.
at throwIfNullOrUndefined (~/Documents/baidu/ps-se-fe-tpl/search-ui-pc/node_modules/ts-morph/dist/ts-morph.js:126:15)
at PropertyAssignment.getInitializerIfKindOrThrow (~/Documents/baidu/ps-se-fe-tpl/search-ui-pc/node_modules/ts-morph/dist/ts-morph.js:10016:20)
at Object.getChildComponents (~/Documents/baidu/ps-se-fe-tpl/search-ui-pc/node_modules/san-ssr/dist/utils/ast-util.js:126:46)
at TypeScriptSanParser.parseComponentClassDeclaration (~/Documents/baidu/ps-se-fe-tpl/search-ui-pc/node_modules/san-ssr/dist/parsers/typescript-san-parser.js:29:44)
at classDeclarations.map.decl (~/Documents/baidu/ps-se-fe-tpl/search-ui-pc/node_modules/san-ssr/dist/parsers/typescript-san-parser.js:22:67)
at Array.map (<anonymous>)
at TypeScriptSanParser.parse (~/Documents/baidu/ps-se-fe-tpl/search-ui-pc/node_modules/san-ssr/dist/parsers/typescript-san-parser.js:22:50)
at SanProject.parseSanSourceFile (~/Documents/baidu/ps-se-fe-tpl/search-ui-pc/node_modules/san-ssr/dist/models/san-project.js:46:80)
at SanProject.compileToSource (~/Documents/baidu/ps-se-fe-tpl/search-ui-pc/node_modules/san-ssr/dist/models/san-project.js:33:36)
at SanProject.compile (~/Documents/baidu/ps-se-fe-tpl/search-ui-pc/node_modules/san-ssr/dist/models/san-project.js:27:21)
at call (~/Documents/baidu/ps-se-fe-tpl/search-ui-pc/node_modules/@baidu/san-php-plugin/dist/lib/callSanSsr.js:67:30)
at callSanSsr (~/Documents/baidu/ps-se-fe-tpl/search-ui-pc/node_modules/@baidu/san-php-plugin/dist/lib/callSanSsr.js:37:17)
at compilation.hooks.finishModules.tapPromise (~/Documents/baidu/ps-se-fe-tpl/search-ui-pc/node_modules/@baidu/san-php-plugin/dist/plugin.js:69:53)
kidnes commented