小编chm*_*lot的帖子

如何使用withRouter,connect,React.Component和自定义属性来输入TypeScript?

我有一个阵营Component使用connect,withRouter并接收自定义属性.我试图将其转换为TypeScript,我想知道我是否正确地这样做.至少,我现在没有错误.

这是显示概念的代码:

import * as React from 'react'
import { connect } from 'react-redux';
import { withRouter, RouteComponentProps } from 'react-router';

import { 
  fetchTestLists,
  newTestList,
  displayTestList,
} from '../../../actions/index';

interface StateProps {
  testList: any;    // todo: use the type of state.myList to have validation on it
}

interface DispatchProps {
  fetchTestLists: () => void;
  newTestList: () => void;
  displayTestList: (any) => void;   // todo: replace any with the actual type
}

interface Props { …
Run Code Online (Sandbox Code Playgroud)

typescript reactjs react-router react-redux typescript2.0

11
推荐指数
2
解决办法
7702
查看次数

FullCalendar 2.3.0悬停时更改日期颜色

我正试图改变鼠标悬停时的日背景颜色.

需要捕获悬停事件.fc-bg .fc-day.fc-content-skeleton .fc-day-number为此目的.这个工作正常,直到我使用背景渲染事件作为allDay事件,因为那时有第三层的类.fc-bg-event-skeleton位于其他两个层的顶部.基础元素的事件不再被触发,因为单元格是使用colspan渲染的,如果连续存在背景渲染事件,我就无法突出显示一天.

是否有可能在fullcalendar中突出显示鼠标悬停的日期?我正在使用月视图.

<div class="fc-bg">...</div>
<div class="fc-content-skeleton">...</div>
<div class="fc-bgevent-skeleton">
    <table><tbody>
        <tr>
             <td class="fc-week-number" style="width:21px"></td>
             <td colspan="3"></td>
             <td colspan="1" class="fc-bgevent available"></td>
             <td colspan="3"></td>
        </tr>
   </tbody></table>
</div>
Run Code Online (Sandbox Code Playgroud)

javascript jquery fullcalendar

2
推荐指数
1
解决办法
6974
查看次数