手写笔如何实现循环?
stylus how to implement a loop?
美好的一天。有一个对象 class 名称和图标的路径。
currentProject = {'current-project': '../../sprites/123.png',
'composition-project': '../../sprites/123.png',
'room': '../../sprites/123.png',
'terms': '../../sprites/123.png',
'documents': '../../sprites/123.png',
'command': '../../sprites/123.png',
'contact': '../../sprites/123.png'}
如何得到结果?
&__current-project:
background-image: url('../../sprites/123.png')
&__room
background-image: url('../../sprites/123.png')
在手写笔中使用迭代语法 for [ ] in
currentProject = {'current-project': '../../sprites/123.png',
'composition-project': '../../sprites/123.png',
'room': '../../sprites/123.png',
'terms': '../../sprites/123.png',
'documents': '../../sprites/123.png',
'command': '../../sprites/123.png',
'contact': '../../sprites/123.png'}
div
for k, v in currentProject
&_{k}
background-image v
输出应该是
div_current-project {
background-image: '../../sprites/123.png';
}
...
美好的一天。有一个对象 class 名称和图标的路径。
currentProject = {'current-project': '../../sprites/123.png',
'composition-project': '../../sprites/123.png',
'room': '../../sprites/123.png',
'terms': '../../sprites/123.png',
'documents': '../../sprites/123.png',
'command': '../../sprites/123.png',
'contact': '../../sprites/123.png'}
如何得到结果?
&__current-project:
background-image: url('../../sprites/123.png')
&__room
background-image: url('../../sprites/123.png')
在手写笔中使用迭代语法 for
currentProject = {'current-project': '../../sprites/123.png',
'composition-project': '../../sprites/123.png',
'room': '../../sprites/123.png',
'terms': '../../sprites/123.png',
'documents': '../../sprites/123.png',
'command': '../../sprites/123.png',
'contact': '../../sprites/123.png'}
div
for k, v in currentProject
&_{k}
background-image v
输出应该是
div_current-project {
background-image: '../../sprites/123.png';
}
...