Write a variable from the vue file in the msg-variable

I have defined an array variable in the data() function in my vue file in 'export default()' and assigned a value in the processMsg function. I would now like to assign this to the msg variable in the js file so that I can view the values with a debug node.

In the debug node, however, I only get an undefiened value.

Is this possible to debug a value, which is assigned in the vue file?

Do you mean you want to send a message back to the server with the value in, or do you mean you want to log it directly from the browser? If you want to log it directly then you can use console.log() to show stuff in the browser developer console.

1 Like

I send the message in the js-file in the on-input event. So I want to take the array from the vue-file and assign the array to the message, which is sent in the js-file.
If there is any other way to log the whole array it would be perfect.

As I said, you can use console.log()

Does the console.log() or context.log() works in the vue-file?
What arguments does the log function need? Because it doesn't works in my code.

You can put it in the js code in the functions in the vue file.

[edit] In onInput for example.

Sorry, that should be console.log() I will correct the previous post.

You've tagged this with uibuilder - are you using uibuilder?

Sorry, my mistake. I don't use uibuilder.

How do I use console.log in the right way? It doesn't log anything in my code :frowning:
The log should appear in the debug window in the node-red flow editor, right?

It depends where you are writing the console log. If you do in the Vue file, it will appear in the dashboards browsers developer tools console. If you do it in the nodes HTML file, it will appear in node-red browser developer tools console. If you do it in the nodes js file, it will appear in STDOUT of the node process. Typically a node does not make entries in the node-red debug sidebar. That is done by the user when they connect the output of your node to a debug node. For commissioning and debugging purposes, a node creator might add a 2nd output to the node that outputs status/debug messages.


Question. Can I make sure I understand - since you have raised this question in Developing Nodes that you are actually developing a new UI node package, not just "using node-red"?

1 Like

I was logging in the vue file an found the log in the browsers developer tools console, thank you! :slight_smile:
Yes, i am working on a new UI node package :smiley:

Which is exactly what I said in my first post.

Yes, thank you. At that point I didn't know what you meant and where to find the logs of the different files...

OK, I've removed the tag.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.