We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ref: baidu/san-ssr#32
目前接受输入为 ts 文件 / js 文件,但错误时输出不包括文件名。例如:
[SAN WARNING] Component template must have a root element.
期望类似:
Error while compiling '/home/hartt.../component.ts': [SAN WARNING] Component template must have a root element.
The text was updated successfully, but these errors were encountered:
思考了一下,起初是想打印出哪个文件没有 root element,但是 San 还要用在浏览器端,不一定有文件信息,因此有两种解决办法:
this.subTag || this.name || clazz.name
createComponent(clazz)
1. 打印标签名、类名
可行,成本最低,灵活性不是很好,依赖于 San 的修改,并且 San 项目中不止一处,但不是每个地方都能获取到类名。
2. 通过 createComponent 创建实例
San 目前的实现方式是有 warn 直接 console.warn,如果需要改成第二种方式,改动比较大,但一劳永逸
console.warn
短期还是第一种方式先优化一下。
Sorry, something went wrong.
提pr?
采用 defineComponent 定义的 San 组件,类名都是 ComponentClass,这个问题不太好解。
defineComponent
ComponentClass
暂时 close 吧,想到好的解决方案再来看这个问题
No branches or pull requests
ref: baidu/san-ssr#32
目前接受输入为 ts 文件 / js 文件,但错误时输出不包括文件名。例如:
期望类似:
The text was updated successfully, but these errors were encountered: