How to call a jQuery function from Dart?

前端 未结 3 1329
灰色年华
灰色年华 2020-12-17 22:53

This is a typical situation in jQuery:

$(\".myClass\").myFunction({
    aKey: \'some value\'
});

H

3条回答
  •  一生所求
    2020-12-17 23:12

    You can do :

    main() {
      js.context.callMethod(r'$', ['.myClass'])
          .callMethod('myFunction', [new js.JsObject.jsify({'aKey': 'some value'})]);
    }
    

提交回复
热议问题