有没有办法为正在使用的项目创建一个私有的 Blazor 组件?
例如,让我们看一下ProjectOne包含两个组件的Razor 类库: omponentComponentA和 component ComponentB。该组件ComponentB是component的子级ComponentA。
ProjectOne 结构体:
一号计划
- - 成分
---------- ComponentA.razor
---------- ComponentB.razor
还有另一个项目是 Blazor 应用程序ProjectTwo。在这个项目中有一个参考ProjectOne。ComponentA在 razor 页面中调用组件时,子组件ComponentB也是可见和可访问的。
有没有办法ComponentB只为ProjectOne在组件中使用它的项目在内部创建这个子组件ComponentA?
我有以下课程:
public abstract class Section
{
}
public class Section<T> : Section where T : new()
{
public string Type { get; set; }
public bool IsFocused { get; set; }
private T sectionData;
public T SectionData
{
get => sectionData == null ? sectionData = new T() : sectionData;
set => sectionData = value;
}
}
public class SectionHeaderData
{
public string Text { get; set; }
public int Level { get; set; }
}
public class SectionParagraphData
{ …Run Code Online (Sandbox Code Playgroud)