1

I initialised a weex and vue app using weex create awesome-project. In the entry.js file I am trying to register a global mixin but it does not seem to be registering. The code is is:

import weex from 'weex-vue-render'
import Vue from 'vue'

Vue.mixin({
  computed: {
    device () {
      return 'mobile'
    },
    browser () {
      return this.device === 'browser'
    },
    mobile () {
      return this.device === 'mobile'
    }
  }
})

weex.init(Vue)

None of the component have this.mobile as true. Works fine in the web simulator but not when I scan the QR code on my phone.

Tuqire Hussain
  • 171
  • 1
  • 11

1 Answers1

0

FYI figured this out. Seems I just had a broken version of Weex! If you find yourself suffering from this problem, simply update Weex, init a new project and move all your code over. Worked like a charm for me.

Tuqire Hussain
  • 171
  • 1
  • 11