jzendo-mina-page
v2.1.2
Published
Add `computed` field supported for MINA `Page` API.
Maintainers
Readme
Page
Add computed field supported for MINA Page API.
Read Page for more.
Using
// Import
const Page2 = require('jzendo-mina-page')
// Using like `Page`
Page2({
data: {
firstName: 'bill',
lastName: 'gates'
},
// Computed fields here
computed: {
fullname: function () {
const {firstName, lastName} = this.data
// Output: `Bill Gates`
return `${firstName.charAt(0).toUpperCase() + firstName.slice(1)} ${lastName.charAt(0).toUpperCase() + lastName.slice(1)}`
}
}
})
Wow, so easy! is it ?
TODO
Well, i just use dirty check, but not so bad! I will opt in future.
