isVNode-composition.uvue 774 字节
Newer Older
DCloud-WZF's avatar
DCloud-WZF 已提交
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
<template>
  <view class="page">
    <view class="mb-10 flex flex-row justify-between">
      <text>isVNode VNode:</text>
      <text id="is-vnode-vnode">{{ isVNodeVNode }}</text>
    </view>
    <view class="mb-10 flex flex-row justify-between">
      <text>isVNode string:</text>
      <text id="is-vnode-string">{{ isVNodeString }}</text>
    </view>
  </view>
</template>

<script setup lang="uts">
  const isVNodeVNode = ref(false)
  const isVNodeString = ref(false)
17 18
  // #ifdef APP-ANDROID
  const vnode = h('text', new Map<string, any | null>(), 'Hello World')
DCloud-WZF's avatar
DCloud-WZF 已提交
19
  // #endif
20 21
  // #ifndef APP-ANDROID
  const vnode = h('text', {}, 'Hello World')
DCloud-WZF's avatar
DCloud-WZF 已提交
22 23 24 25
  // #endif
  isVNodeVNode.value = isVNode(vnode)
  isVNodeString.value = isVNode('abc')
</script>