UNPKG
vue-filter2
Version:
latest (0.1.6)
0.1.6
0.1.4
0.1.3
0.1.2
0.1.1
A collection of Vue.js filters
github.com/bum/vue-filters
bum/vue-filters
vue-filter2
/
src
/
filters
/
string
/
placeholder.js
13 lines
(10 loc)
•
274 B
JavaScript
View Raw
1
2
3
4
5
6
7
8
9
10
11
12
13
import
{ isBlank }
from
'../util'
/** * If the value is missing outputs the {placeholder} * * (null, {placeholder}) => {placeholder} * ('foo', {placeholder}) => 'foo' */
export
const
placeholder
= (
val, placeholder
) =>
isBlank
(val) ? placeholder : val