When a component is opened by navigating to its route, style isolation does not work, the styles are not applied, but if you add this component to another, then the styles work. I can't understand if this is a feature of the framework or my mistake
When a component is opened by navigating to its route, it's already a component within another component, so it will work exactly the same as your second case. So I think the answer is "my mistake".
As you've provided no code, here's a very simple demo page showing it working in a routed component.
@page "/"
<h3 class="makemered">Test</h3>
@code {
}
.makemered {
background-color: red;
color: white;
}
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.