Access df-value inside component
See original GitHub issueHi @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:
- Created 2 years ago
- Comments:7 (3 by maintainers)
Top 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 >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
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
Hi @SilasNiewierra
Try mitt library: https://github.com/jerosoler/Drawflow/issues/102#issuecomment-766333278