Passing or adding a key from a parent to a card modal with @click

I am trying to pass a key from a parent to a card modal with an @click to a namedAction. I have a list processed by Vue and want to include the value from the list to a card modal.
Here is my HTML:

<div v-for="line in" class="ml-1">
<p class="font-normal text-gray-900">{{line.propAddress}}&nbsp; -- <a class="text-sm text-gray-900 font-bold underline" @click="namedAction('accountChangeOwner',{passPropAddress:line.propAddress})" href="#">I'm not the owner</a></p>

I can’t figure out how to get the passPropAddress key to show up in the model of the card modal. When I run the debugger, I can see the passPropAddress key in actions.options. I know I am doing something right because the @click action is passing the key as an option of the namedAction. I am so close, I think.

Looks to me like you need to take the quotes off of the line.propAddress section. It’s evaluating that as a string instead of actually navigating the object

I edited my post. I didn’t have the single quotes in there and the debugger shows the value being passed correctly. When I bring up the card modal, I want to be able to access those options in my card modal and set them in the model of the card model or maybe pass them as options in my UtilityHook that runs when the form is submitted in the card modal.

For that, you’ll need to add a “function” key to the action that shows your card modal and use JavaScript to move the data. It should look something like…

  "action": "showCardModal",
  "function": "action.options.model.SOMETHING = action.options.passPropAddress",
  "options": {
    "model": {}
    (... more options here ...)

Just be sure to include the model key in your options, even if it’s an empty object and the function should work as you expect

1 Like

Thank you, that works.