提交 97db86bb 编写于 作者: DCloud-WZF's avatar DCloud-WZF 💬

refactor(inject): 兼容低版本 ios 模拟器

上级 b043eb7e
......@@ -6,7 +6,7 @@
<text class="mt-10 obj">obj: {{JSON.stringify(obj)}}</text>
<text class="mt-10 arr">arr: {{JSON.stringify(arr)}}</text>
<text class="mt-10 arr-0">arr[0]: {{ arr[0]}}</text>
<text class="mt-10 fn">fn: {{fn?.()}}</text>
<text class="mt-10 fn">fn: {{fnRes}}</text>
<text class="mt-10 has-injection-context">hasInjectionContext:
{{checkHasInjectionContextRes}}</text>
<button class="mt-10 check-has-injection-context-btn" @click="checkHasInjectionContext">check
......@@ -19,7 +19,11 @@
const num = inject('num')
const obj = inject('obj')
const arr = inject<number[]>('arr', [99])
const fn = inject<() => string>('fn')
const fn = inject<() => string>('fn')
const fnRes = ref('')
if(fn !== null){
fnRes.value = fn()
}
const checkHasInjectionContextRes = ref('')
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册