我有2个onClick函数正在运行,一个又一个但不运行

时间:2020-06-15 03:28:25

标签: javascript reactjs

我为onClick,彩票和createAlert运行了2个功能。 createAlert未创建警报。我做错了什么?另外,如果有人可以告诉我如何将彩票功能改回以按钮的Id作为参数,那将不胜感激,因为当我将第二个功能添加到onClick时,它就停止了工作。

plot_list <- lapply(panel, function(x) {
  ggplot(data = df %>% filter(panel == x), aes(x = value, y = region)) +
         geom_point() +
         theme(axis.title.x = element_blank()) +
         facet_wrap(. ~ panel) +
         {if (x == 0) scale_y_discrete(position = "left") else scale_y_discrete(position = "right")} +
         {if (x == 1) theme(axis.title.y = element_blank())}
})

do.call("grid.arrange", c(plot_list, ncol = 2, bottom = "value"))

1 个答案:

答案 0 :(得分:1)

  1. client = Client('http://www.example/xmlrpc.php', 'username', 'password') post = WordPressPost() post.title = 'title' post.content = 'content' post.post_status = 'publish' post.wp_page_template = "custom_template.php" templates = client.call(pages.GetPageTemplates()) print(f"These are the Templates: {templates}") post.id = client.call(posts.NewPost(post)) 回调中调用您的createAlert函数,它在该回调中返回警报jsx,这就是为什么警报未在组件中呈现的原因。
  2. onClick中,有5条lottery语句,它违反了DRY原理。
    您应该尝试以下方法:

setState

相关问题