mirror of
https://github.com/the1812/Bilibili-Evolved.git
synced 2025-11-04 21:22:45 +08:00
Add oldValue in validator
This commit is contained in:
parent
767edadfaa
commit
084776ccd3
@ -42,7 +42,7 @@ export interface ComponentTag {
|
|||||||
/** 设置面板中的呈现顺序 */
|
/** 设置面板中的呈现顺序 */
|
||||||
order: number
|
order: number
|
||||||
}
|
}
|
||||||
type ComponentOptionValidator<T> = (value: T) => T | undefined | null
|
type ComponentOptionValidator<T> = (value: T, oldValue: T) => T | undefined | null
|
||||||
/** 组件选项信息
|
/** 组件选项信息
|
||||||
* @todo 需要 extends 出更具体的 Option 类型, 现在这样混一起太乱
|
* @todo 需要 extends 出更具体的 Option 类型, 现在这样混一起太乱
|
||||||
*/
|
*/
|
||||||
|
|||||||
@ -33,7 +33,7 @@ export const textControlMixin = Vue.extend({
|
|||||||
emitChange() {
|
emitChange() {
|
||||||
let { value } = this.$refs.input
|
let { value } = this.$refs.input
|
||||||
if (this.validator) {
|
if (this.validator) {
|
||||||
value = this.validator(value)
|
value = this.validator(value, this.text)
|
||||||
if (this.changeOnBlur) {
|
if (this.changeOnBlur) {
|
||||||
this.$refs.input.value = value
|
this.$refs.input.value = value
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user