Tencent/wepy

Uncaught TypeError: mix is not a constructor

Open

#2,501 opened on Dec 17, 2019

View on GitHub
 (3 comments) (0 reactions) (0 assignees)JavaScript (3,055 forks)batch import
good first issue

Repository metrics

Stars
 (22,403 stars)
PR merge metrics
 (No merged PRs in 30d)

Description

引入如下js文件

//home.wpy
import mix from '@/mixins/tabs/xxx.js'
export default class extends wepy.page {
     mixins=[mix]
}

//xxx.js
import wepy from 'wepy'
export default class extends wepy.mixin{
  data = {
      ...
    }
    onLoad() {
            this.getData()
        }
    async getData() {
            const { data: res } = await wepy.request({
                url: 'xxxx',
                method: 'GET',
                data: {}
            })
          ...
        }
}


保存xxx.js文件,或wepy文件时间歇报错Uncaught TypeError: mix is not a constructor

代码没问题 偶发编译问题

Contributor guide