Skip to content

natjs/weex-nat-modal

Repository files navigation

nat-modal

Installation

weexpack plugin add nat-modal
npm i natjs

Usage

Use in weex project (.vue/.we)

<script>
import Nat from 'natjs'

// alert
Nat.alert('Hello Nat!')

// confirm
Nat.confirm('This is a confirm dialog with callback', (err, ret) => {
    console.log((ret) ? 'confirmed' : 'canceled')
})

// prompt
Nat.prompt('This is a prompt dialog with callback', (err, ret) => {
    console.log((ret.result) ? 'prompted\n' + ret.data : 'canceled')
})

// toast
Nat.toast('Hello Nat!')

</script>

See the Nat Documentation for more details.