main.js
app.config.globalProperties.$http = http;
index.vue
<script setup>
import { getCurrentInstance } from 'vue';
const { ctx } = getCurrentInstance();
console.log(ctx)
</script>
产品分类: uniapp/H5
PC开发环境操作系统: Windows
PC开发环境操作系统版本号: win10
HBuilderX类型: Alpha
HBuilderX版本号: 3.3.12
浏览器平台: Chrome
浏览器版本: 96.0.4664.45
项目创建方式: HBuilderX
main.js
app.config.globalProperties.$http = http;
index.vue
<script setup>
import { getCurrentInstance } from 'vue';
const { ctx } = getCurrentInstance();
console.log(ctx)
</script>
读出对应值
没有对应属性
main.js
app.config.globalProperties.$http = http;
index.vue
<script setup>
import { getCurrentInstance } from 'vue';
const { ctx } = getCurrentInstance();
console.log(ctx)
</script>
ctx内读不出对应的值
9***@qq.com
可否再写明白点?没懂,就是看了官网这个文档也没懂
2022-04-02 14:43