如何解决无法使用@HostBinding和阴影dom封装进行样式设置
我有以下角度分量
@Component({
selector: 'app-bar',templateUrl: './bar.component.html',styleUrls: ['./bar.component.scss'],encapsulation: ViewEncapsulation.ShadowDom,changeDetection: ChangeDetectionStrategy.OnPush
})
export class BarComponent {
@Input() @HostBinding('class') cls;
}
所以我想,如果我将cls
设置为“隐藏我”,则会将其隐藏。我在bar.component.scss中添加了以下内容:
:host {
&.hide-me {
display: none;
}
}
这没有任何作用,它与影子dom封装有关。如果删除该行,它将再次按预期工作。有什么建议为什么shadowDom不再起作用?并且有一种方法可以通过启用影子dom来解决此问题;)
解决方法
更改您的scss以使其正常工作
In file included from src_c/gfxdraw.c:33:
In file included from src_c/pygame.h:32:
src_c/_pygame.h:216:10: fatal error: 'SDL.h' file not found
#include <SDL.h>
^~~~~~~
1 error generated.
---
For help with compilation see:
https://www.pygame.org/wiki/MacCompile
To contribute to pygame development see:
https://www.pygame.org/contribute.html
---
error: command 'gcc' failed with exit status 1
----------------------------------------
ERROR: Command errored out with exit status 1:
/Library/Frameworks/Python.framework/Versions/3.8/bin/python3 -u -c 'import sys,setuptools,tokenize; sys.argv[0] = '"'"'/private/var/folders/3m/w8365k4s59qfzct1l8ph77fh0000gn/T/pip-
install-oijhzzti/PyGame/setup.py'"'"';
__file__='"'"'/private/var/folders/3m/w8365k4s59qfzct1l8ph77fh0000gn/T/pip-install-
oijhzzti/PyGame/setup.py'"'"';f=getattr(tokenize,'"'"'open'"'"',open).
(__file__);code=f.read().replace('"'"'\r\n'"'"','"'"'\n'"'"');f.close();exec(compile(code,__file__,'"'"'exec'"'"'))' install --record
/private/var/folders/3m/w8365k4s59qfzct1l8ph77fh0000gn/T/pip-record-598hwe63/install-
record.txt --single-version-externally-managed --compile --install-headers
/Library/Frameworks/Python.framework/Versions/3.8/include/python3.8/PyGame Check the logs
for full command output.
有关更多信息,请参考this question
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。