我有一个CSS3交替行样式的表,但我需要覆盖几行的样式.
这是表格的CSS:
table.primary tr:nth-child(odd) {
background-color: #e5e5e5;
}
table.primary tr:nth-child(even) {
background-color: #ededed;
}
Run Code Online (Sandbox Code Playgroud)
我需要覆盖一些具有非常不同的背景颜色(和其他格式)的行,我希望只添加一个class=到各个行,但似乎这不会覆盖上面的CSS.
例如
<table class="primary">
<tr><td>one</td></tr>
<tr class="new"><td>two</td></tr>
<tr><td>three</td></tr>
</table>
Run Code Online (Sandbox Code Playgroud)
或者我需要跳过CSS3和只使用一个class="row1",class="row2",class="new"来代替.
关于如何覆盖nth-child类的任何建议?
我正在使用Swagger PHP,并且大多数定义很容易定义,但我遇到的问题是某个特定的数据不属于单独的类,而是一个关联数组.
我希望展示的json响应(针对此问题进行了简化):
{
"id": 1,
"status": "published",
"gps": {
"lat": "0.00000000",
"lng": "0.00000000"
}
Run Code Online (Sandbox Code Playgroud)
的id和status足够易于限定,然而,gps是一个问题,因为没有单独的类中定义它,它是模型内的阵列.是否可以定义此数组而无需创建虚拟类?
目前模型文件中的注释:
/**
* @SWG\Definition(@SWG\Xml(name="Event"))
*/
class Event extends BaseModel {
/**
* @SWG\Property(
* property="id",
* type="integer",
* example="103"
* )
* @SWG\Property(
* property="status",
* type="string",
* enum={"published", "draft", "suspended"}
* example="published"
* )
*/
}
Run Code Online (Sandbox Code Playgroud) 我可以使用页面中的InvokeActionItem轻松共享项目,但我需要能够在listview项目中调用它.我已设法触发调用,但我无法弄清楚触发它时如何添加数据.我一直收到错误信息
InvocationPrivate :: setQuery:不允许更改InvokeQuery对象
注意:我试图用纯QML来做这个,如果有必要,我会通过c ++来做,但QML会更好.
在Page对象内部运行的代码:
actions: [
InvokeActionItem {
ActionBar.placement: ActionBarPlacement.OnBar
title: "Share"
query {
mimeType: "text/plain"
invokeActionId: "bb.action.SHARE"
}
onTriggered: {
//myTextProperty is a string variable property for the page.
data = myTextProperty;
}
}
]
Run Code Online (Sandbox Code Playgroud)
我尝试在其他项目中使用的代码如下,但不起作用:
Container {
gestureHandlers: [
TapHandler {
LongPressHandler {
onLongPressed: {
console.log("Longpress");
invokeQuery.setData("test");
invokeShare.trigger("bb.action.SHARE");
}
}
]
attachedObjects: [
Invocation {
id: invokeShare
query: InvokeQuery {
id:invokeQuery
mimeType: "text/plain"
}
}
]
}
Run Code Online (Sandbox Code Playgroud)
有没有办法只使用QML更改调用的数据,还是需要通过c ++运行它?