File tree Expand file tree Collapse file tree 1 file changed +5
-5
lines changed
Expand file tree Collapse file tree 1 file changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -145,7 +145,7 @@ data() {
145145``` js
146146props: [' size' ],
147147computed: {
148- normalizedSize : function () {
148+ normalizedSize () {
149149 return this .size .trim ().toLowerCase ()
150150 }
151151}
@@ -183,22 +183,22 @@ app.component('my-component', {
183183 type: Object ,
184184 // Object or array defaults must be returned from
185185 // a factory function
186- default : function () {
186+ default () {
187187 return { message: ' hello' }
188188 }
189189 },
190190 // Custom validator function
191191 propF: {
192- validator : function (value ) {
192+ validator (value ) {
193193 // The value must match one of these strings
194- return [' success' , ' warning' , ' danger' ].indexOf (value) !== - 1
194+ return [' success' , ' warning' , ' danger' ].includes (value)
195195 }
196196 },
197197 // Function with a default value
198198 propG: {
199199 type: Function ,
200200 // Unlike object or array default, this is not a factory function - this is a function to serve as a default value
201- default : function () {
201+ default () {
202202 return ' Default function'
203203 }
204204 }
You can’t perform that action at this time.
0 commit comments