electron - node-notifier snoretoast 按钮文本如何支持中文
问题描述
notifier.removeAllListeners();
notifier.notify(
{
message: 'Hello',
wait: true,
timeout: false,
actions: ['确认', '取消'],
},
function (err, data) {
// Will also wait until notification is closed.
console.log('Waited');
console.log('确认');
console.log(err, data);
// if(`${data}`.toString('utf8le') == '确认') {
// console.log('866666633333333')
// }
}
);
notifier.on('activate', () => {
console.log('Clicked!');
});
notifier.on('dismissed', () => {
console.log('Dismissed!');
});
// Buttons actions (lower-case):
notifier.on('确认', () => {
console.log('"Ok" was pressed');
});
notifier.on('取消', () => {
console.log('"Cancel" was pressed');
});
如果我使用中文,则不会执行相应的事件。应该是buff转换后激活类型发生了变化。如何解决这个问题呢。请帮我。谢谢你。 在此处输入图像描述
更多信息可以在这里找到在这里输入链接描述
解决方案
推荐阅读
- swift - swiftui @State 值取决于 @ObservedObject ViewModel 初始化错误
- mongodb - 具有排序和不等式的 MongoDB 索引
- linux - Bash 脚本 sftp 仅将文件下载到同一目录脚本位于
- oracle - 如何使用kerberized身份验证代理到Oracle数据库链接中的另一个数据库用户
- python - 将 Django 从 2.1 升级到 2.2.13 时如何修复 pyodbc 依赖错误?
- openstack - openstack 错误:virNetSocketReadWire:1806:读取数据时文件结束:输入/输出错误
- python - 使用 BeautifulSoup 在 Python 中抓取特定的 div
- php - 使用键和值创建PHP数组时如何分配变量
- mongodb - 如何在 MongoDB 中的 $group 内创建嵌套数组?
- sql - 定期进行 DB 到 DB 映射