npm i --save ns-sweet-alert
- 版本:1.1.3
- GitHub:
- NPM: https://npmjs.net.cn/package/ns-sweet-alert
- 下载次数
- 昨日:0
- 上周:0
- 上月:0
ns-sweet-alert
为 NativeScript 实现的 sweet alert 对话框
请简要介绍您的插件!
许可证
本插件由 Tomas 根据 MIT 许可证授权
基于
Android: sweet-alert-dialog by @pedant iOS: (wip) SweetAlert-iOS by @codestergit
当前状态
目前您可以做的并不多,但我会在这几天内添加新功能。
安装
要安装,请输入
tns plugin add ns-sweet-alert
用法
一旦添加到项目中,在主页面.js 类似的文件中,可以这样操作
var app = require('application');
var SweetAlert = require('ns-sweet-alert');
var alertNice = function() {
SweetAlert.simpleAlert(app.android.foregroundActivity).setTitleText("hey!").setContentText("this is a sweetmessage");
}
var inError = function(args) {
SweetAlert.errorAlert(app.android.foregroundActivity).setTitleText("Oops!").setContentText(args);
}
exports.alertNice = alertNice;
exports.inError = inError;
当前类型
simpleAlert(context)
errorAlert(context)
warningAlert(context)
successAlert(context)
//you can use various methods with the dialog result
.setTitleText
.setContentText
.setConfirmText
我将继续添加更多内容,比如这周添加 iOS 支持!
到此为止!
享受它。