A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://github.com/bootstrap-vue/bootstrap-vue/commit/498a26219571bb6108aaa7134dc25c8e1ff6c98f below:

fix value prop validation when using directory mode… · bootstrap-vue/bootstrap-vue@498a262 · GitHub

File tree Expand file treeCollapse file tree 1 file changed

+9

-7

lines changed

Filter options

Expand file treeCollapse file tree 1 file changed

+9

-7

lines changed Original file line number Diff line number Diff line change

@@ -12,11 +12,17 @@ import formStateMixin from '../../mixins/form-state'

12 12

import idMixin from '../../mixins/id'

13 13

import normalizeSlotMixin from '../../mixins/normalize-slot'

14 14 15 +

// --- Constants ---

16 + 15 17

const NAME = 'BFormFile'

16 18 17 19

const VALUE_EMPTY_DEPRECATED_MSG =

18 20

'Setting "value"/"v-model" to an empty string for reset is deprecated. Set to "null" instead.'

19 21 22 +

// --- Helper methods ---

23 + 24 +

const isValidValue = value => isFile(value) || (isArray(value) && value.every(v => isValidValue(v)))

25 + 20 26

// @vue/component

21 27

export const BFormFile = /*#__PURE__*/ Vue.extend({

22 28

name: NAME,

@@ -34,17 +40,13 @@ export const BFormFile = /*#__PURE__*/ Vue.extend({

34 40

value: {

35 41

type: [File, Array],

36 42

default: null,

37 -

validator: val => {

43 +

validator: value => {

38 44

/* istanbul ignore next */

39 -

if (val === '') {

45 +

if (value === '') {

40 46

warn(VALUE_EMPTY_DEPRECATED_MSG, NAME)

41 47

return true

42 48

}

43 -

return (

44 -

isUndefinedOrNull(val) ||

45 -

isFile(val) ||

46 -

(isArray(val) && (val.length === 0 || val.every(isFile)))

47 -

)

49 +

return isUndefinedOrNull(value) || isValidValue(value)

48 50

}

49 51

},

50 52

accept: {

You can’t perform that action at this time.


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4