我在使用vuex的项目中使用VeeValidate。 我有一个简单的输入字段的问题,用作setter 数组的长度。默认长度= 3.看起来像这样:
Public Sub PaintVignette(ByVal b As Bitmap, ByVal uColor As Color, ByVal bounds As Rectangle)
Dim d As Double = 0.70712
Using g As Graphics = Graphics.FromImage(b)
Dim ellipsebounds As Rectangle = bounds
ellipsebounds.Offset(-ellipsebounds.X, -ellipsebounds.Y)
Dim x As Integer = ellipsebounds.Width - CInt(Math.Round(d * ellipsebounds.Width))
Dim y As Integer = ellipsebounds.Height - CInt(Math.Round(d * ellipsebounds.Height))
ellipsebounds.Inflate(x, y)
Using path As GraphicsPath = New GraphicsPath()
path.AddEllipse(ellipsebounds)
Using brush As PathGradientBrush = New PathGradientBrush(path)
brush.WrapMode = WrapMode.Tile
brush.CenterColor = Color.FromArgb(0, 0, 0, 0)
brush.SurroundColors = New Color() {Color.FromArgb(255, uColor.R, uColor.G, uColor.B)}
Dim blend As Blend = New Blend()
blend.Positions = New Single() {0F, 0.2F, 0.4F, 0.6F, 0.8F, 1.0F}
blend.Factors = New Single() {0F, 0.5F, 1.0F, 1.0F, 1.0F, 1.0F}
brush.Blend = blend
Dim oldClip As Region = g.Clip
g.Clip = New Region(bounds)
g.FillRectangle(brush, ellipsebounds)
g.Clip = oldClip
End Using
End Using
End Using
End Sub
我想要做的是在模糊上更改数组,但在输入时验证字段。 现在,当我在此字段中键入51(太大的值)时,v-validate将其更改为3(默认值)。 在这种情况下我想要实现的是v-validate在用户输入51(输入时)时显示错误,但保持值= 51直到模糊。
v-validate是否可以限制它仅显示错误的角色(即,如果输入无效,则不将字段值设置为默认值)?