haml 语法 - 更好的编写方式?
一定有更好的写法 - 我只是不确定如何(使用 staticmatic)-
- if current_page.include? "0.html"
- @current_index = 1
- if current_page.include? "1.html"
- @current_index = 2
- if current_page.include? "2.html"
- @current_index = 3
- if current_page.include? "3.html"
- @current_index = 4
- if current_page.include? "4.html"
- @current_index = 5
- if current_page.include? "5.html"
- @current_index = 6
- if current_page.include? "6.html"
- @current_index = 7
- if current_page.include? "7.html"
- @current_index = 8
- if current_page.include? "8.html"
- @current_index = 9
- if current_page.include? "9.html"
- @current_index = 10
- if current_page.include? "10.html"
- @current_index = 11
- if current_page.include? "11.html"
- @current_index = 12
There must be a better way of writing this- I'm just not sure how (using staticmatic)-
- if current_page.include? "0.html"
- @current_index = 1
- if current_page.include? "1.html"
- @current_index = 2
- if current_page.include? "2.html"
- @current_index = 3
- if current_page.include? "3.html"
- @current_index = 4
- if current_page.include? "4.html"
- @current_index = 5
- if current_page.include? "5.html"
- @current_index = 6
- if current_page.include? "6.html"
- @current_index = 7
- if current_page.include? "7.html"
- @current_index = 8
- if current_page.include? "8.html"
- @current_index = 9
- if current_page.include? "9.html"
- @current_index = 10
- if current_page.include? "10.html"
- @current_index = 11
- if current_page.include? "11.html"
- @current_index = 12
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)