sendHttpRequest weex 发送网络请求

sendHttpRequest ^5.1.2

weex 发送网络请求

#请求参数

Prop Type Required Default Description
options Object Y {} 请求参数

#接口调用示例

this.$bridge
    .sendHttpRequest(params)
    .then(res => {    
    this.$alert(res)
    })
    .catch(err => {
    this.$toast(err)
    })
  • 调用示例:
export default {
    ...
    methods: {
        click() {
            let params = {
                data: {}
                options: {}
            };
            this.$bridge
            .sendHttpRequest(params)
            .then((resp) => {
                //执行自定义逻辑
            }, (error) => {
                console.log("error");
            });
        }
    
    }
    ...
}

#返回参数

  • N/A
posted on 2024-12-17 09:32  AtlasLapetos  阅读(34)  评论(0)    收藏  举报