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
617 views
in Technique[技术] by (71.8m points)

weex-toolkit(v1.0.5)初始化工程后无法正常preview,一个难受的小问题麻烦尽快看看

一直在关注Weex的发展,也在不停的研究。今天更新了weex-toolkit(v1.0.5),重新初始化前端工程,启动服务后发现页面无法正常显示(以前的版本不会)。操作步骤如下:

查看版本:

yulongshengdeMacBook-Pro:Downloads tonyyls$ weex -v
   v1.0.5
 - weex-builder : v0.2.6
 - weex-devtool : v0.2.79
 - weex-previewer : v1.3.7
 - weexpack : v0.3.12

初始化工程:

yulongshengdeMacBook-Pro:Downloads tonyyls$ weex init ppdemo
prompt: Init your Project:  (ppdemo) 
file: /Users/tonyyls/Downloads/ppdemo/.babelrc created.
file: /Users/tonyyls/Downloads/ppdemo/.eslintrc created.
file: /Users/tonyyls/Downloads/ppdemo/.gitignore created.
file: /Users/tonyyls/Downloads/ppdemo/README.md created.
file: /Users/tonyyls/Downloads/ppdemo/app.js created.
file: /Users/tonyyls/Downloads/ppdemo/assets/phantom-limb.js created.
file: /Users/tonyyls/Downloads/ppdemo/assets/qrcode.js created.
file: /Users/tonyyls/Downloads/ppdemo/assets/qrcode.min.js created.
file: /Users/tonyyls/Downloads/ppdemo/assets/style.css created.
file: /Users/tonyyls/Downloads/ppdemo/assets/url.js created.
file: /Users/tonyyls/Downloads/ppdemo/build/init.js created.
file: /Users/tonyyls/Downloads/ppdemo/index.html created.
file: /Users/tonyyls/Downloads/ppdemo/package.json created.
file: /Users/tonyyls/Downloads/ppdemo/src/foo.vue created.
file: /Users/tonyyls/Downloads/ppdemo/webpack.config.js created.
file: /Users/tonyyls/Downloads/ppdemo/weex.html created.
yulongshengdeMacBook-Pro:Downloads tonyyls$ 

安装依赖

cd ppdemo
npm install 

安装成功后,执行npm run dev, 之后执行npm run serve ,服务正常启动,然而,界面预览却什么都显示不出来。 访问 http://localhost:8080/

图片描述

声明:
之前安装的旧版本工程在本机上正常运行Preview。这些都属于框架层面的小问题吧。为啥每次更新总有些地方让开发者难受呢??容易打击到开发者的信心~


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

1 Answer

0 votes
by (71.8m points)

我在开发时候一般不用weex-toolkit。有些坑也没踩过,不过这个看日志应该是资源没有加载到吧,你可以看看你的index.html文件,从这里出发看看问题。


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

...