API对象

2020-12-29 10:56 更新

api对象

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

api对象使用示例:

  1. <template>
  2. <view class='header'>
  3. <text>{this.data.title}</text>
  4. </view>
  5. </template>
  6. <script>
  7. export default {
  8. name: 'ApiTest',
  9. apiready(){
  10. api.toast({msg: '网络错误'});
  11. this.data.title = '网络错误';
  12. },
  13. data(){
  14. return {
  15. title: 'Hello APP'
  16. }
  17. }
  18. }
  19. </script>
  20. <style>
  21. .header{
  22. height: 45px;
  23. }
  24. </style>
以上内容是否对您有帮助:
在线笔记
App下载
App下载

扫描二维码

下载编程狮App

公众号
微信公众号

编程狮公众号