我是Ionic 2的新手,我想问一下如何更改ionic组件的样式?
我遇到了一个问题,如下图所示:
<form action="">
<ion-list>
<ion-item>
<ion-label fixed>Username</ion-label>
<ion-input type="text" value="" clearInput></ion-input>
</ion-item>
<ion-item>
<ion-label fixed>Password</ion-label>
<ion-input type="password" clearInput></ion-input>
</ion-item>
</ion-list>
</form>
Run Code Online (Sandbox Code Playgroud)
每个项目之间有 3 条灰线,长的一条是 ion-list 的,短的一条是 ion-item 的。
我尝试覆盖 theme/variables.scss 中的样式,但似乎没有设置。
我认为覆盖“.list-ios .item-block .item-inner”的样式不是一个好主意,还有其他方法可以解决这个问题吗?
谢谢。
我在if / else逻辑检查后发现一些处理问题。让我们举个例子。
基本配置
const result = {
data: 1,
state: {
pass: 'N'
}
}
Run Code Online (Sandbox Code Playgroud)
对于JS if / else检查,逻辑检查后不应显示日志
function checking() {
if(result.state.pass !== 'Y') {
return result;
}
console.log("Should not appear the log")
}
checking()
Run Code Online (Sandbox Code Playgroud)
然后,我尝试使用Ramda cond函数进行翻译
function checking() {
R.cond([
[
R.compose(R.not, R.equals('Y'), R.prop('pass'), R.prop('state')),
(res) => res
]
])(result)
console.log("Should not appear the log")
}
checking()
Run Code Online (Sandbox Code Playgroud)
但是,日志出现在Ramda cond示例中。我可否知道
有什么问题吗?
我可以在该示例上进行哪些增强?
谢谢。