码迷,mamicode.com
首页 > 微信 > 详细

小程序开发遇到的坑及解决

时间:2019-05-22 15:58:49      阅读:187      评论:0      收藏:0      [点我收藏+]

标签:通过   组件   sha   port   不能   三方   程序开发   enter   with   

1,第三方组件样式修改:

  以iview webapp为例,不能直接通过其class的类名直接修改组件样式,可通过i-class来给组件添加类名,通过i-class来修改样式。

<i-page i-class="ipage" current="{{ page }}" total="{{ total }}" bind:change="handleChange">
   <view slot="prev">
        <i-icon type="return"></i-icon>
          上一页
       </view>
       <view slot="next">
          下一页
       <i-icon type="enter"></i-icon>
   </view>
</i-page>
<style>
.ipage{
  height: 64px!important;
}
</style>

2,使用wepy时,异步更新数据,手动刷新dom的时候需要使用this.$apply()

3,当需要循环渲染WePY组件时(类似于通过wx:for循环渲染原生的wxml标签),必须使用WePY定义的辅助标签<repeat>

 <!-- 注意,使用for属性,而不是使用wx:for属性 -->
    <repeat for="{{list}}" key="index" index="index" item="item">
    </repeat>

 

4,小程序语音功能,通过同声传译插件

https://developers.weixin.qq.com/community/develop/doc/0004aa70d609e099c1d671b2a56009

 

5,帮助文档通过web-view组件展示

 

6,地图上绘制多边形和点直接使用map组件相应的能力

 

7,转发功能:

wx.showShareMenu({
   withShareTicket: true
})

 

8,主动获取位置授权: 

https://developers.weixin.qq.com/community/develop/doc/000cea2305cc5047af5733de751008

<button bindtap="openSetting">打开设置页</button>  openSetting() {  wx.openSetting()}

  

 

小程序开发遇到的坑及解决

标签:通过   组件   sha   port   不能   三方   程序开发   enter   with   

原文地址:https://www.cnblogs.com/liuwei54/p/10906002.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!