2.1.2 • Published 4 years ago

jzendo-mina-page v2.1.2

Weekly downloads
1
License
MIT
Repository
github
Last release
4 years ago

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.