javaScript --> dialog [ Alert、toash、sheet ... ]
$ npm install react-native-rxdialog --save
演示 web
/ show web
https://rxreactnative.github.io/react-native-rxdialog-example/
RXAlert.show(
'DIY Alert title(标题)',
'content (Can`t click on the background) \n内容 ---- 不可以 [ 点击背景]',
[
{ text: 'confirm(确认)', style:{color: 'green', fontSize: 20} },
{ text: 'cancel(取消)', style:{color: 'brown', fontSize: 10} }
], (index)=>{
console.log('click index='+ index);
},{
// in Android , text多行的 fontSize 必须有 lineHeight
contentTextStyle: { color: 'blue', fontSize: 16, lineHeight: 20}
},{
titleTextStyle: { color: 'orange', fontSize: 20 }
}
);
# writing is more convenient
AlertUtil.activity(()=>{
console.log('9 - right - click sure')
})
AlertUtil.action(()=>{
console.log('10 - left - click sure')
})
web work
npm run web-nginx-dev
# or
npm run web-build-prod