📜  级联符号 - Dart 代码示例

📅  最后修改于: 2022-03-11 14:48:02.495000             🧑  作者: Mango

代码示例1
// Dart Cascade notation: myObject..someMethod()
querySelector('#confirm')
..text = 'Confirm'
..classes.add('important')
..onClick.listen((e) => window.alert('Confirmed!'));
// can replace (you don’t need the button variable):
var button = querySelector('#confirm');
button.text = 'Confirm';
button.classes.add('important');
button.onClick.listen((e) => window.alert('Confirmed!'));