weexpack create [project name]
cd [project name]
npm install natjs --save
weexpack plugin add [nat moudle]
...
Use Nat in vue/weex file (.vue
/.we
)
<script>
import Nat from 'natjs'
// Make a phone call
Nat.call('415-736-0000')
// Take a photo
Nat.camera.captureImage((err, ret) => {
console.log('Path: ', ret.path)
})
// Get device info
Nat.device.info((err, ret) => {
console.log('Info: ', ret)
})
</script>