Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

关于路径的问题 #23

Open
ll232489865 opened this issue Mar 4, 2017 · 1 comment
Open

关于路径的问题 #23

ll232489865 opened this issue Mar 4, 2017 · 1 comment

Comments

@ll232489865
Copy link

pipe(tmodjs({
templateBase: 'template'
}))

令我感到困惑的是这里的templateBase 参数,不写,gulp 编译不通过, 但是我把参数改成
'hahaha' , 'heiheihei' , 在生成的template.js 里面得不到更合的反应;

弄明白这个参数的动力源自于我遇到的路径问题,我按照文档的默认写法,最终.....
得到的template.js 底下的生成代码写的是绝对路径
template('/Users/longlei/Desktop/营天下/src/template/footer','div code');

https://github.com/aui/tmodjs/ 给出的demo 写法则是

<script> var html = template('news/list', _list); document.getElementById('list').innerHTML = html; </script>

这里的'new/list' 明显是一个相对路径嘛,所以这就是我遇到的问题, template.js 里面输出的template函数的参数为什么是绝对路径

@chenxihub
Copy link

这个怎么解决的,我遇到的相同的问题

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants