We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
3.2.37
https://sfc.vuejs.org/#__DEV__eNq1U0tu1EAQvUrhjT1i7FYmC6SRPQRlAwt2SGx6Y+yascH9UXd7CLJ8Ec7CnbgC1W7HmcwgIiJl5/r0e1WvnofondbZscdoG+W2Mq12YNH1esdlK7QyDgYwuF/DAd1tbwxK90FaV8oKYYS9UQJieh4v7VXTdvXVXMlYCD0DtVSKnoKwByg8aBK/x65T8FmZrn4Vr7jMWZiB2ClwKHRXOqQIIG+udsMwPR7HnFE0ZVupewfHVKgau4JHVOdRKAXqXT7PQMmcLZDROgoDp6LU2VerJCkw+Hd8LlgebWHK+Bwt4GMeNc5pu2Wsl/rbIauUYDdUY6aXrhWY1krcXGeb7PoNq1vrTvMZWpF+Meq7RUOMPFqfgDNKHtGkJHCNBs0/yc56HxGe1S5IPefI5UgCPNzmyesr+VHRJlj//egD9BZvPdxSp9MrIZQk0jNzbB6bYzObg4SYDTLAvpcEVCyoCXnjwjyfmtZCa3//+umtw+UyY5KsoNh5kCQOO8arqeP/7RUmZBfeWXYj5RYNnvxFuMS7qZdGq1yr5MmCwWr3Amij7n5MElyCejHgAcKvKUuBM0LAUB1mnTokcVPaaam38Rpi+oihlQF9QoHwnfmW1wV4nNkgQCK73sh7VKI5t850uRe3zgv6YvM8X5xaYfwDNIbPsg==
common.js :
import { getCurrentInstance } from 'vue' export function useChild() { const { proxy } = getCurrentInstance() function fun(name) { console.log('has msg ?', 'msg' in proxy) proxy.msg += name } return { fun } }
app.vue :
<script setup> import { ref, getCurrentInstance } from 'vue' import child1 from './child1.vue' const msg = ref('Hello World!') </script> <template> <h1>{{ msg }}</h1> <input v-model="msg"> <child1></child1> </template>
child1.vue :
<script setup> import { ref, onMounted } from 'vue' import { useChild } from './common.js' import child2 from './child2.vue' const { fun } = useChild() const msg = ref('This is:') onMounted(() => fun('child1')) </script> <template> <h1>{{ msg }}</h1> <child2/> </template>
in prod env, The proxy contain msg
in prod env, The proxy not contain msg
No response
The text was updated successfully, but these errors were encountered:
add:
//work in this case <script lang="ts"> setup() { // do something..... } </script> // not work <script lang="ts" setup> </script>
Sorry, something went wrong.
This has been fixed in 3.2.45, but maybe not in the way you want it to. See:
#6248 f73925d
No branches or pull requests
Vue version
3.2.37
Link to minimal reproduction
https://sfc.vuejs.org/#__DEV__eNq1U0tu1EAQvUrhjT1i7FYmC6SRPQRlAwt2SGx6Y+yascH9UXd7CLJ8Ec7CnbgC1W7HmcwgIiJl5/r0e1WvnofondbZscdoG+W2Mq12YNH1esdlK7QyDgYwuF/DAd1tbwxK90FaV8oKYYS9UQJieh4v7VXTdvXVXMlYCD0DtVSKnoKwByg8aBK/x65T8FmZrn4Vr7jMWZiB2ClwKHRXOqQIIG+udsMwPR7HnFE0ZVupewfHVKgau4JHVOdRKAXqXT7PQMmcLZDROgoDp6LU2VerJCkw+Hd8LlgebWHK+Bwt4GMeNc5pu2Wsl/rbIauUYDdUY6aXrhWY1krcXGeb7PoNq1vrTvMZWpF+Meq7RUOMPFqfgDNKHtGkJHCNBs0/yc56HxGe1S5IPefI5UgCPNzmyesr+VHRJlj//egD9BZvPdxSp9MrIZQk0jNzbB6bYzObg4SYDTLAvpcEVCyoCXnjwjyfmtZCa3//+umtw+UyY5KsoNh5kCQOO8arqeP/7RUmZBfeWXYj5RYNnvxFuMS7qZdGq1yr5MmCwWr3Amij7n5MElyCejHgAcKvKUuBM0LAUB1mnTokcVPaaam38Rpi+oihlQF9QoHwnfmW1wV4nNkgQCK73sh7VKI5t850uRe3zgv6YvM8X5xaYfwDNIbPsg==
Steps to reproduce
common.js :
app.vue :
child1.vue :
What is expected?
in prod env, The proxy contain msg
What is actually happening?
in prod env, The proxy not contain msg
System Info
No response
Any additional comments?
No response
The text was updated successfully, but these errors were encountered: