Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
557 views
in Technique[技术] by (71.8m points)

var xxx = weex.requireModule('xxx') 引入报错

图片描述

在 demo.vue 文件中引入:var navigator = weex.requireModule('navigator'),
然后 npm run dev 就报错,

Uncaught TypeError: weex.requireModule is not a function

不知道这是什么情况?


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

怎么感觉你搞错环境了,只用在.we的环境下才会出这个。.vue环境下是应该不会出这个。你试试在playground下执行一下试试?图片描述


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...