如何处理#&引用;带SASS的Backbone.js需要
我正在尝试使用带有指南针的SASS来创建图像精灵。然而,我也在使用backbone.js,所以我的url看起来像:如何处理#&引用;带SASS的Backbone.js需要,backbone.js,sass,compass-sass,Backbone.js,Sass,Compass Sass,我正在尝试使用带有指南针的SASS来创建图像精灵。然而,我也在使用backbone.js,所以我的url看起来像:http://localhost/social/#/dashboard 所以当我使用@时,包括箭头精灵($name)它给了我一个类似于:http://localhost/social/#/images/sidebar_buttons/arrow-sa2b2afd371.png 哪个chrome inspector给了我这个错误:资源被解释为图像,但使用MIME类型text/html传
http://localhost/social/#/dashboard
所以当我使用@时,包括箭头精灵($name)
它给了我一个类似于:http://localhost/social/#/images/sidebar_buttons/arrow-sa2b2afd371.png
哪个chrome inspector给了我这个错误:资源被解释为图像,但使用MIME类型text/html传输
如果我从url中删除“#”,则图像加载良好。我的config.rb看起来像:
http_path = "/social/"
project_path = "C:/wamp/social"
css_dir = "styles/css"
sass_dir = "styles/sass"
images_dir = "images"
javascripts_dir = "js"
在config.rb中启用相关资产:
relative_assets = true
请尝试在config.rb中启用相对资源:relative_assets=true
或切换到绝对URL或使用根目录中的路径。@cimmanon添加您的答案,这样我就可以给您评分了!:)