Skip to content

Commit 49142c1

Browse files
committed
style: 增加 100% 宽度样式
1 parent 1934423 commit 49142c1

File tree

4 files changed

+40
-56
lines changed

4 files changed

+40
-56
lines changed

src/BootstrapBlazor.Server/BootstrapBlazor.Server.csproj

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@
3131
<PackageReference Include="BootstrapBlazor.BootstrapIcon.Extensions" Version="9.0.0" />
3232
<PackageReference Include="BootstrapBlazor.Chart" Version="9.0.0" />
3333
<PackageReference Include="BootstrapBlazor.CherryMarkdown" Version="9.0.0" />
34-
<PackageReference Include="BootstrapBlazor.CodeEditor" Version="9.0.1" />
3534
<PackageReference Include="BootstrapBlazor.Dock" Version="9.0.0" />
3635
<PackageReference Include="BootstrapBlazor.DockView" Version="9.0.1" />
3736
<PackageReference Include="BootstrapBlazor.DriverJs" Version="9.0.0" />

src/BootstrapBlazor.Server/Components/Components/Pre.razor.css

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
border-radius: var(--bs-border-radius);
55
overflow: hidden;
66
direction: ltr;
7+
width: 100%;
78
}
89

910
.pre-code:not(:last-child) {

src/BootstrapBlazor.Server/Components/Samples/CodeEditors.razor

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,7 @@
2727
</Select>
2828
</div>
2929
<div class="col-12">
30-
<CodeEditor Value="@Code" Language="@Language" Theme="@Theme" OnValueChanged="OnValueChanged" />
31-
</div>
32-
<div class="col-12">
33-
<ConsoleLogger @ref="Logger"></ConsoleLogger>
30+
<Pre>&lt;CodeEditor Value="@@Code" Language="@@Language" Theme="@@Theme" OnValueChanged="OnValueChanged" /&gt;</Pre>
3431
</div>
3532
</div>
3633
</DemoBlock>

src/BootstrapBlazor.Server/Components/Samples/CodeEditors.razor.cs

Lines changed: 38 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,6 @@ namespace BootstrapBlazor.Server.Components.Samples;
1010
/// </summary>
1111
public partial class CodeEditors
1212
{
13-
[NotNull]
14-
private ConsoleLogger? Logger { get; set; }
15-
1613
[NotNull]
1714
private string? Code { get; set; }
1815

@@ -76,15 +73,6 @@ void Main()
7673
return Task.CompletedTask;
7774
}
7875

79-
private Task OnValueChanged(string? value)
80-
{
81-
if (!string.IsNullOrEmpty(value))
82-
{
83-
Logger.Log(value);
84-
}
85-
return Task.CompletedTask;
86-
}
87-
8876
private Task OnThemeSelectedItemChanged(SelectedItem item)
8977
{
9078
if (item.Value == "vs-dark")
@@ -105,45 +93,44 @@ private Task OnThemeSelectedItemChanged(SelectedItem item)
10593
return Task.CompletedTask;
10694
}
10795

108-
private IEnumerable<AttributeItem> GetAttributeItems()
96+
private static List<AttributeItem> GetAttributeItems()
10997
{
110-
return new List<AttributeItem>()
111-
{
112-
new AttributeItem()
113-
{
114-
Name = nameof(CodeEditor.Value),
115-
Type = "string",
116-
DefaultValue = "-",
117-
Description = Localizer["Value"]
118-
},
119-
new AttributeItem()
120-
{
121-
Name = nameof(CodeEditor.Theme),
122-
Type = "string",
123-
DefaultValue = "vs",
124-
Description = Localizer["Theme"]
125-
},
126-
new AttributeItem()
127-
{
128-
Name = nameof(CodeEditor.Language),
129-
Type = "string",
130-
DefaultValue = "csharp",
131-
Description = Localizer["Language"]
132-
},
133-
new AttributeItem()
134-
{
135-
Name = nameof(CodeEditor.ValueChanged),
136-
Type = "EventCallback<string?>",
137-
DefaultValue = "-",
138-
Description = Localizer["ValueChanged"]
139-
},
140-
new AttributeItem()
141-
{
142-
Name = nameof(CodeEditor.OnValueChanged),
143-
Type = "Func<string?,Task>",
144-
DefaultValue = "-",
145-
Description = Localizer["ValueChanged"]
146-
},
147-
};
98+
return [
99+
//new()
100+
//{
101+
// Name = nameof(CodeEditor.Value),
102+
// Type = "string",
103+
// DefaultValue = "-",
104+
// Description = Localizer["Value"]
105+
//},
106+
//new()
107+
//{
108+
// Name = nameof(CodeEditor.Theme),
109+
// Type = "string",
110+
// DefaultValue = "vs",
111+
// Description = Localizer["Theme"]
112+
//},
113+
//new()
114+
//{
115+
// Name = nameof(CodeEditor.Language),
116+
// Type = "string",
117+
// DefaultValue = "csharp",
118+
// Description = Localizer["Language"]
119+
//},
120+
//new()
121+
//{
122+
// Name = nameof(CodeEditor.ValueChanged),
123+
// Type = "EventCallback<string?>",
124+
// DefaultValue = "-",
125+
// Description = Localizer["ValueChanged"]
126+
//},
127+
//new()
128+
//{
129+
// Name = nameof(CodeEditor.OnValueChanged),
130+
// Type = "Func<string?,Task>",
131+
// DefaultValue = "-",
132+
// Description = Localizer["ValueChanged"]
133+
//}
134+
];
148135
}
149136
}

0 commit comments

Comments
 (0)