Skip to content

Commit 46cd61f

Browse files
committed
Merge pull request #222 from vinicius73/patch-1
A simple example of the possibility of turning a json on an object
2 parents 8e776c9 + c92db43 commit 46cd61f

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/guide/components.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -324,6 +324,11 @@ Vue.component('example', {
324324
coerce: function (val) {
325325
return val + '' // cast the value to string
326326
}
327+
},
328+
propH: {
329+
coerce: function (val) {
330+
return JSON.parse(val) // cast the value to Object
331+
}
327332
}
328333
}
329334
})

0 commit comments

Comments
 (0)