注意 cml-yanxuan不在维护,迁移到 https://github.com/beatles-chameleon/cml-demo
仿网易严选demo
npm i -g [email protected]
- clone 当前项目
- 在项目根目录执行
npm install
- 启动项目
cml dev
其中地图功能 ./map/components/map
使用了多态组件
web | 微信小程序 | native-weex | 百度小程序 | 支付宝小程序 |
---|---|---|---|---|
仿网易严选的跨端cml应用
注意 cml-yanxuan不在维护,迁移到 https://github.com/beatles-chameleon/cml-demo
仿网易严选demo
npm i -g [email protected]
npm install
cml dev
其中地图功能 ./map/components/map
使用了多态组件
web | 微信小程序 | native-weex | 百度小程序 | 支付宝小程序 |
---|---|---|---|---|
template errors:
[2 (line), 8 (column)] component "app" doesn't have a defined property named "store"
bug描述 cml build后的发布包首页无法正常显示
复现bug的步骤
npm install -g http-server
cd cml-yanxuan
修改 chameleon.config.js
const publicPath = 'http://192.168.0.108:8080/cml-yanxuan/dist';
// 设置api请求前缀
const apiPrefix = 'http://192.168.0.108:8080';
cml build
cd ..
http-server
访问 http://192.168.0.108:8080/cml-yanxuan/dist/web/cml-yanxuan.html#/
无法正常显示
但是点击进入/cml/h5/list 页面却显示正常
试了下官方发布的地址也是同样的问题
https://chameleon-team.github.io/cml-yanxuan/dist/web/cml-yanxuan.html#/
经调试发现index页下相关cml.get的调用返回的res都是string,因此res.code为undefined,if(res.code ==0){} 这个逻辑不会被调用,而list页面确实正常的
cml.get({
url: '/cml-yanxuan/mock/getHomeImgList.json'
}).then(res => {
if (res.code == 0) {
const {special, disscountPriceImgUrl} = res.data;
this.special = special;
this.disscountPriceImgUrl = disscountPriceImgUrl;
}
}).catch(err => {
console.log(err)
})
问题截图
编译环境信息
chameleon-tool 版本:[email protected]
nodejs版本、npm版本:[node v10.9.0、npm 6.2.0]
电脑操作系统:windows8 amd64
运行环境信息
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.