问题描述
我在 Parcel 有一个项目。我想使用 HTML5 模板标签作为模板并使用 Mustache 呈现它。下面的代码非常解释:
<template id="template"><img src="{{ profile_picture }}"></template>
<script>
var template = document.getElementById('template').innerHTML;
var rendered = Mustache.render(template,{profile_picture: '[path to image]'});
document.body.innerHTML = rendered;
</script>
但是当我尝试运行这个parcel时,我认为{{ profile_picture }}是一个需要由parcel自己填充的资产。我收到此错误:
$ parcel index2.html
Server running at http://localhost:1234
{{ profile_picture }}: ENOENT: no such file or directory,open '/project/{{ profile_picture }}'
有什么办法可以解决这个问题吗?也许是将 {{ profile_picture }} 标记为不是资产的转义字符?或者也许在 Mustachejs 上有什么方法可以将 {{ }} 符号更改为另一个符号?
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)