Skip to content

Commit 5fefa43

Browse files
committed
refactor: 完善逻辑
1 parent 7bd0ceb commit 5fefa43

File tree

1 file changed

+23
-2
lines changed

1 file changed

+23
-2
lines changed

src/BootstrapBlazor/Components/Typed/Typed.razor.cs

Lines changed: 23 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,12 +77,33 @@ public async Task TriggerComplete()
7777
private bool UpdateParameters()
7878
{
7979
var ret = false;
80-
if (Text != _text || Options?.ToString() != _lastOptions)
80+
if (Text != _text)
8181
{
8282
_text = Text;
83-
_lastOptions = Options?.ToString();
83+
ret = true;
84+
}
85+
86+
if (!ret)
87+
{
88+
var optionString = GetOptionsString();
89+
if (optionString != _lastOptions)
90+
{
91+
_lastOptions = optionString;
92+
}
8493
ret = true;
8594
}
8695
return ret;
8796
}
97+
98+
private string GetOptionsString()
99+
{
100+
var ret = "";
101+
if (Options == null)
102+
{
103+
return ret;
104+
}
105+
106+
var textString = Options.Text == null ? "" : string.Join(",", Options.Text);
107+
return $"{Options} {textString}";
108+
}
88109
}

0 commit comments

Comments
 (0)