1- // Licensed to the .NET Foundation under one or more agreements.
1+ // Licensed to the .NET Foundation under one or more agreements.
22// The .NET Foundation licenses this file to you under the Apache 2.0 License
33// See the LICENSE file in the project root for more information.
44// Maintainer: Argo Zhang(argo@live.ca) Website: https://www.blazor.zone
@@ -21,7 +21,7 @@ public partial class IpAddress
2121 /// <summary>
2222 /// 获得 class 样式集合
2323 /// </summary>
24- protected string ? ClassName => CssBuilder . Default ( "ipaddress form-control" )
24+ protected string ? ClassName => CssBuilder . Default ( "bb-ip form-control" )
2525 . AddClass ( "disabled" , IsDisabled )
2626 . AddClass ( CssClass ) . AddClass ( ValidCss )
2727 . Build ( ) ;
@@ -62,7 +62,6 @@ private void ValueChanged1(ChangeEventArgs args)
6262 {
6363 Value1 = Value1 [ 0 ..3 ] ;
6464 }
65-
6665 UpdateValue ( ) ;
6766 }
6867
@@ -112,4 +111,22 @@ private void UpdateValue()
112111 {
113112 CurrentValueAsString = $ "{ Value1 } .{ Value2 } .{ Value3 } .{ Value4 } ";
114113 }
114+
115+ /// <summary>
116+ /// 更新 值方法供 JS 调用
117+ /// </summary>
118+ /// <param name="v1"></param>
119+ /// <param name="v2"></param>
120+ /// <param name="v3"></param>
121+ /// <param name="v4"></param>
122+ [ JSInvokable ]
123+ public void TriggerUpdate ( int v1 , int v2 , int v3 , int v4 )
124+ {
125+ Value1 = v1 . ToString ( ) ;
126+ Value2 = v2 . ToString ( ) ;
127+ Value3 = v3 . ToString ( ) ;
128+ Value4 = v4 . ToString ( ) ;
129+
130+ UpdateValue ( ) ;
131+ }
115132}
0 commit comments