You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In my extension, Use UI components to pass icon addresses to components in javascript like this:
icon: require('../../assets/style/images/toolbar/data.png')
install the extension
Expected behavior
The icons on the UI can be displayed normally in jupyterlab 1.2.x, but when I upgrade both jupyterlab and my extensions to 2.0, the icons can not show.
The css in jupyterlab2.0 (can not show):
element.style {
background-image: url([object Module]);
}
The css in jupyterlab1.0 (can show):
element.style {
background-image: url(/static/lab/30c3271d3802174d50e946b597b430ac.png");
}
Are there any alternatives?
My requirement is: I can reference the image files in the style directory of my project in the JavaScript of my plugin.
Because I use a third-party UI framework, I need the icon address as an input parameter
@WangChangsongGit It sounds like your element is missing some of the styling props required to actually display background-image. You can try adding the jp-Icon class to your element, which in jupyterlab is associated with the following CSS:
I'm currently having that issue, but with an img tag in my extension. I tried adding the jp-Icon class, but no visible change was seen. It happened after a switch to 2.0 as well. Any help would be appreciated!
EDIT: I just tried using require().default instead of just require() per the gitter discussion and it worked! Thanks!
Description
Reproduce
In my extension, Use UI components to pass icon addresses to components in javascript like this:
icon: require('../../assets/style/images/toolbar/data.png')
install the extension
Expected behavior
The icons on the UI can be displayed normally in jupyterlab 1.2.x, but when I upgrade both jupyterlab and my extensions to 2.0, the icons can not show.
The css in jupyterlab2.0 (can not show):
element.style {
background-image: url([object Module]);
}
The css in jupyterlab1.0 (can show):
element.style {
background-image: url(/static/lab/30c3271d3802174d50e946b597b430ac.png");
}
Context
Troubleshoot Output
Command Line Output
Browser Output
The text was updated successfully, but these errors were encountered: