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>
更多建議: