question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Access df-value inside component

See original GitHub issue

Hi @jerosoler ,

can you tell me if this is possible? I want to display the current node data in the step. So far I did it with something like this:

<input
    df-duration
  />

But is it possible to access the df-duration in the component somehow? I would like to do something like this:

<template>
  <input
    :value="readableTimeUnits('df-duration')"
  />
  <!-- or -->
  <p>{{readableTimeUnits('df-duration')}}</p>
  </template>
<script>
  ...
  readableTimeUnits(unit) {
        return {
          [TimeUnits.MINUTE]: 'Minute(n)',
          [TimeUnits.HOUR]: 'Stunde(n)',
          [TimeUnits.DAY]: 'Tag(e)',
          [TimeUnits.WEEK]: 'Woche(n)',
          [TimeUnits.MONTH]: 'Monate(n)',
        }[unit]
      },
</script>

So in the end the input displays a readable string and not the value itself?

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:7 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
SilasNiewierracommented, Oct 18, 2021

Hi @jerosoler , thanks I tried it with https://github.com/scottcorgan/tiny-emitter and it seems to work 👍 Now I can set and retrieve data 😄 thanks a lot

Read more comments on GitHub >

github_iconTop Results From Across the Web

how to access value of a input tag in a component through ...
There are many ways to accomplish this. The simplest one would be to set up state in your App component to keep track...
Read more >
Accessing Data through Props with Known Key Names in ...
The state and props in React are always in an object format. This means that the value could be accessed from the state...
Read more >
Component State - React
Passing an update function allows you to access the current state value inside the updater. Since setState calls are batched, this lets you...
Read more >
React: How To Access Props In A Functional Component
Now you can access those props. But! You do not use the keyword “this”. Since it's not a class you don't have to...
Read more >
Accessing previous props or state with React Hooks
useEffect is only called after the component is rendered with the previous value. Only after the render is done is the ref object...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found