在我的数据表加载后点击const PrivateRoute = ({ component: Component, exact, strict, path, ...rest }) => (
<Route
exact={exact}
strict={strict}
path={path}
render={props =>
fakeAuth.isAuthenticated ? (
<Component {...props} {...rest} />
) : (
<Redirect
to={{
pathname: "/login",
state: { from: props.location }
}}
/>
)
}
/>
);
,然后我收到提醒。但这仅适用于数据表分页的第一页。如果我去另一个页面它就不再工作了。
.mytext
答案 0 :(得分:2)
您应该使用事件delegation
(http://api.jquery.com/on/)。您可以绑定document
或“父元素”,而不是直接绑定在元素上,然后设置target
。
以下是一个例子:
$(document).on("click", ".mytext", function () {
alert("something happens");
});