vue-examples icon indicating copy to clipboard operation
vue-examples copied to clipboard

The description of "Global Properties" was incorrect

Open WangZhenHao opened this issue 1 year ago • 0 comments

https://skirtles-code.github.io/vue-examples/patterns/global-properties.html

This article say that the lack of availability in setup is a major problem, so let's consider some other alternatives to globalProperties.

This statement has a mistake. we can use getCurrentInstance method to get the gobal properties.

` import { ref, getCurrentInstance } from 'vue';

const { proxy } = getCurrentInstance(); `

https://github.com/vuejs/core/issues/2233

WangZhenHao avatar Jan 29 '24 08:01 WangZhenHao