4.5 使用JSSDK

优质
小牛编辑
125浏览
2023-12-01

千牛JSSDK 提供了各种SDK能力。

所有能力列表参见:

以下演示调用千牛JSSDK解析queryString的情况。

/** @jsx createElement */
import {createElement, Component} from 'weex-rx';
import {mount} from 'nuke-mounter';
import {View, Button , Modal} from 'nuke';
import QN from 'QAP-SDK';

class BridgeDemo extends Component {
    constructor() {
        super();

    }

    parseQueryString() {
        let q = QN.uri.parseQueryString('x=1&y=2');
        Modal.toast(typeof q);
    }

    render(){
        var self=this;
        return (
              <View>

                <View style={app.btnGroup}>
                    <Button block="true" onPress={() => {this.parseQueryString()}} type="primary">QN.uri.parseQueryString</Button>
                </View>

            </View>
        )
    }
}
mount(<BridgeDemo />, 'body');