阅读(266) (27)

API对象

2020-12-28 17:27:59 更新

api对象

兼容APICloud已有api对象所有函数及属性。参考API对象文档

api对象使用示例:

<template>  
    <view class='header'>
        <text>{this.data.title}</text>
    </view>  
</template>  
<script>
    export default {  
        name: 'ApiTest',
        apiready(){
            api.toast({msg: '网络错误'});
            this.data.title = '网络错误';
        },
        data(){
            return {
                title: 'Hello APP'
            }
        }
    }
</script>
<style>
    .header{
        height: 45px;
    }
</style>