protoType替换为config.globalProperties
原文地址
在main.js中:
vue2
Vue.prototype.$verson = '1.0.0'
使用
this.$verson
vue3
Vue.config.globalProperties.$verson = '1.0.0'
使用
<script setup lang="ts">
import {getCurrentInstance} from 'vue'
console.log(getCurrentInstance().appContext.config.globalProperties.$verson)
</script>