问题标签 [grommet]
For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.
javascript - 如何测试呈现顶级的酶成分
我正在尝试测试一个呈现索环 Menu
组件的组件。grommetMenu
组件将一个绝对定位的菜单呈现到文档的顶层,作为子级插入到body
. 因此,它呈现在包装器的范围之外。我可以通过document.body.innerHTML
(参考 jsdom 文档)找到它,但我想使用酶与它进行交互。有什么建议吗?
我的测试:
执行此操作的索环中的线document.body.insertBefore(drop.container, document.body.firstChild);
。https://github.com/grommet/grommet/blob/master/src/js/utils/Drop.js#L197
只是在寻找有关处理此问题的最佳方法的一些指导。谢谢!
reactjs - 如何将 mailchimp 集成到 grommet.io 表单中?
希望在登录页面上创建电子邮件注册表单。我正在使用一个名为 Grommet (grommet.github.io) 的反应组件库。为了使用 mailchimp 捕获电子邮件,我的 onClick 功能需要什么?
reactjs - sass-loader 不能与 webpack + react + grommet 一起使用
我正在尝试开始使用 webpack 和 Grommet 一起工作。我正在关注本教程:https ://github.com/grommet/grommet-standalone但我收到以下错误:
显然,它在源目录而不是 node_modules 中寻找 scss 文件 - 但我不知道是什么导致了错误或如何修复它。
我正在使用这个 sass 加载器:https ://github.com/jtangelder/sass-loader
因为这个,我正在使用 webpack 2.10:https ://stackoverflow.com/a/39608145/1596288
此外,这些是我的 webpack.config.babel.js 和 index.js 文件:
和 ...
javascript - 在 React 中强制调用 mapStateToProps
我正在构建一个 react/redux 应用程序并在前端使用一个名为 Grommet 的 ux 库。我设置了应用程序,以便在页面上的一组手风琴中包含一系列表单。这是一个仅包含一个手风琴标签的精简版本:
- 所有这些工作正常。问题是,当我调用 handleCpuChange 函数时,我的状态/存储值会更新 - 但我的实际“值”或“默认值”字段保持不变。在大多数情况下,这没有问题,但如果我关闭并重新打开手风琴,这些字段中的值将重置为通过 props 提供的默认值/值。我认为解决这个问题的一个好方法是在手风琴打开或关闭时将状态重新映射到道具,以更新实际值 - 但我不确定如何在不重新加载整个页面的情况下执行此操作。
webpack - 让 Grommet 与 webpack 2 一起工作
我正在尝试在我的应用程序中设置 Grommet-standalone。
我刚刚了解到 webpack 配置中的自定义属性不再受支持。所以sassLoader
不起作用。我似乎无法替代webpack.LoaderOptionsPlugin
, 来工作。
这个类似问题的解决方案对我不起作用。
看看我的webpack.config.js
:
这是我得到的错误:
为了完整起见,这是我的package.json
有没有人让 Grommet 与 webpack2 一起工作?谷歌在这种情况下没有太多帮助。
javascript - 更改索环组件的 colorIndex
如何更改索环中组件的颜色索引,例如图标、图表?
提前致谢。
node.js - 在 vscode 中调试 grommet-cli 示例应用程序
喜欢Grommet和 vscode。试图让他们一起玩。我可以让 Express 和 vscode 工作,如此处所示。我想让grommet-cli 示例应用程序以类似方式工作。Express 有一个启动命令:“npm start”,其中 grommet-cli 有两个:“npm run dev-server”和“npm run dev”(不知道如何在 vscode 中启动它们。我想我可能需要多会话调试?)。如何设置 launch.json 来调试示例应用程序?我希望能够在 IE/Edge 中进行调试。我使用 Debugger for Chrome 扩展在 Chrome 中取得了一些成功。
这是我当前的launch.json:
}
reactjs - Does Enzyme only work with lower level components?
I'm writing some unit tests for React/Redux/Grommet app. For testing I'm using Jest/Enzyme/Chai/Sinon.
I have the following component:
And the following test fails :
With this error:
I've tried to simulate the onChange function a couple of different ways, mainly taking ideas from here and here. i.e.
I'm starting to wonder if the simulate
method of enzyme has trouble interacting with higher level library components like the ones from grommet or if it needs to be applied directed to a lower-level <input>
tag. Has anyone experienced this sort of thing?
javascript - Grommet: Top and Bottom Tab activate the same content
I'm wondering is there a way to set Tabs top and Bottom to display the tabs content using grommet tabs component:
example of what I am looking to do can be seen in the image below.
http://imgur.com/pkWRzUh
I have a sample codepen with a quick mock up.