You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
"otherComponentRef" and "otherComponentReactive" both change or not
What is actually happening?
"otherComponentReactive" work fine
"otherComponentRef" work in <script>, broken in <script setup>
The text was updated successfully, but these errors were encountered:
LinusBorg
changed the title
Can i import a ref from another .vue file?
script setup: ref imported from a .vue file doesn't seem to update when used in anothr component's template
Dec 1, 2020
I am not sure if i can import a ref object from another ".vue" file...
Use <script setup>, the template will compile to
import{toDisplayStringas_toDisplayString,createVNodeas_createVNode,Fragmentas_Fragment,openBlockas_openBlock,createBlockas_createBlock}from"/@modules/vue.js"exportfunctionrender(_ctx,_cache,$props,$setup,$data,$options){return(_openBlock(),_createBlock(_Fragment,null,[_createVNode("div",null,_toDisplayString($setup.localRef),1/* TEXT */),_createVNode("div",null,_toDisplayString($setup.localReactive.data),1/* TEXT */),_createVNode("div",null,_toDisplayString($setup.otherComponentRef)),_createVNode("div",null,_toDisplayString($setup.otherComponentReactive.data),1/* TEXT */),_createVNode("button",{onClick: $setup.changeValue},"change")],64/* STABLE_FRAGMENT */))}
Version
3.0.3
Reproduction link
https://github.com/CHOYSEN/can_i_import_ref_from_.vue_file
Steps to reproduce
yarn
yarn dev
open browser and click the button
What is expected?
"otherComponentRef" and "otherComponentReactive" both change or not
What is actually happening?
"otherComponentReactive" work fine
"otherComponentRef" work in <script>, broken in <script setup>
The text was updated successfully, but these errors were encountered: