Skip to content

58702064/mpvue-iview-weapp

 
 

Repository files navigation

mpvue-iview-weapp

使用mpvue通过usingComponents导入iview-weapp

预览

1. git clone
git clone https://github.com/wkl007/mpvue-iview-weapp.git

2. 安装依赖
cd mpvue-iview-weapp && npm install

3. 启动程序
npm run dev

4. 预览
打开微信开发者工具,新建项目,将目录指向 /dist 即可

问题

若原生组件通过click事件,即this.triggerEvent('click', { index })来进行父子组件通信,mpvue无法从event.mp中读取到正确的detail,原因是因为mpvueclick事件编译为tap导致this.triggerEvent('click', { index })无法找到click句柄

暂时解决方案

修改组件库click事件名称,例如:

this.triggerEvent('click', { index }) => this.triggerEvent('iclick', { index })

对应的模板中:

@click => @iclick

注:本次示例中修改了action-sheetmodal组件

受影响组件(仅传值情况受影响)

  1. action-sheet
  2. modal

About

使用mpvue导入iview-weapp

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 65.7%
  • Vue 34.2%
  • HTML 0.1%