File tree Expand file tree Collapse file tree 1 file changed +11
-8
lines changed
python/api-examples-source Expand file tree Collapse file tree 1 file changed +11
-8
lines changed Original file line number Diff line number Diff line change 11import streamlit as st
22
3+ CSS = """
4+ a {
5+ color: var(--st-link-color) !important;
6+ }
7+ """
8+
39JS = """
410export default function(component) {
511 const { data, setTriggerValue, parentElement } = component;
6- parentElement.innerHTML = data;
7- const links = parentElement.querySelectorAll('a');
12+ const newElement = document.createElement('div');
13+ parentElement.appendChild(newElement);
14+ newElement.innerHTML = data;
15+
16+ const links = newElement.querySelectorAll('a');
817
918 links.forEach((link) => {
1019 link.onclick = (e) => {
1423}
1524"""
1625
17- CSS = """
18- a {
19- color: var(--st-link-color);
20- }
21- """
22-
2326my_component = st .components .v2 .component (
2427 "inline_links" ,
2528 css = CSS ,
You can’t perform that action at this time.
0 commit comments