Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

labletype html contain js #401

Open
withlin opened this issue Apr 29, 2020 · 0 comments
Open

labletype html contain js #401

withlin opened this issue Apr 29, 2020 · 0 comments

Comments

@withlin
Copy link

withlin commented Apr 29, 2020

let html= `
  <html>
 <head>
  <script type="text/javascript">

   function changeFunc() {
    alert("12131");
   }

  </script>
 </head>
 <body>
  <button type="button" on-click="changeFunc()">Change</button>
 </body>
</html>
  `

  let data = {
    nodes: [
      {
        id: "1",
        label: "<h3>Node 1</h3>",
        labelType: "html"
      },
      {
        id: "2",
        label: html,
        labelType: "html",
        config: {
          style: 'fill: #afa'
        }
      }
    ],
    links: [
      {
        source: '1',
        target: '2',
        label: 'TO',
        config: {
          arrowheadStyle: 'display: none',
          curve: d3.curveBasis
        }
      },
    ]
  }

but the changeFunc function is not working.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant