didi / chameleon

🦎 一套代码运行多端,一端所见即多端所见
http://cml.didi.cn/
Apache License 2.0
9.02k stars 692 forks source link

小程序怎么和h5共用一个图片路径 #236

Open gaofengfengfeng opened 5 years ago

gaofengfengfeng commented 5 years ago

../../static/img/radar.png in /usr/local/lib/node_modules/chameleon-tool/node_modules/cml-vue-loader/lib/template-compiler?{"id":"data-v-321501eb","hasScoped":true,"optionsId":"0","buble":{"transforms":{}}}!/usr/local/lib/node_modules/chameleon-tool/node_modules/cml-vue-loader/lib/selector.js?type=template&index=0!/usr/local/lib/node_modules/chameleon-tool/node_modules/chameleon-loader/src??ref--12-1!./src/components/chatitem/chatitem.cml

设置的满足小程序的图片路径,在编译h5时确报错,h5的图片路径又该如何设置呢

luobinbinchina commented 5 years ago

可否贴一下源代码……理论上require一个本地的静态资源就可以

gaofengfengfeng commented 5 years ago

image

gaofengfengfeng commented 5 years ago

命名变了

beatles-chameleon commented 5 years ago

命名变了

直接使用 require 即可引用资源,命名变化相关地址会修改。 参见上线指南:https://cml.js.org/doc/framework/deploy.html#2-%E9%9D%99%E6%80%81%E8%B5%84%E6%BA%90%E5%8F%91%E5%B8%83%E8%B7%AF%E5%BE%84