0

My code

 const props = defineProps({
 isOpen: {
    type: Boolean,
    default: true,
    default: false,
  },
 closeModal: {
    type: Function,
    required: true,
  },
 closeModal2: {
    type: Function,
    //  access and change the value of the prop => props.isOpen
  },
});

I want to get and change the value of isOpen in closeModel2 prop. Is it possible? If yes then how can we achieve it?

1 Answer 1

1

You can't. What you can do is emit an event from that component to the parent component which controls the isOpen reactive value and change it there.

something like this: https://sfc.vuejs.org/#eNqFkU1vgzAMhv+KlUtbqZA7o9U+tPN22G3ZgYJZ00ESxaE7IP77HChoX9pusWM/tt+3FzfOpecORSZyKr12AQhD5/bK6NZZH+DuqJsKam9bUCKVYxg7lLhaanqP9TDXzH8AypTWUABNDw4N7IDL1sF3uOHvXE7zeBIHAVvXFAE5AsinmZmmxHLjTomJoARcl40lXDLMrIuGeKDkzlwuGLEV025JW7j0RNbwhf241OWDlMhgzMTcuHTGj2MIjjIpqS7jlSdKrX+V/Ep9Z4JuMUVqk4O374SewUpsPzEkJ8/oE4+mQo/+L+a30h/ciB2UGfiURfRfbKqw1gYfvXW0Hs+ZlMng1toGCxZ3iHLPXmCrA6s2dd1zQOvn1Sjq6uU/Ww5dCNZED3T5xh5E1vrSvFFi/4RNA67giwIEGzecredo9CmXE2PiVfq87/u5ZhhyGTNffRw+AKBw68Q=

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.