isVNode-composition.uvue 622 字节
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
  const vnode = h('text', {}, 'Hello World')
DCloud-WZF's avatar
DCloud-WZF 已提交
18 19
  isVNodeVNode.value = isVNode(vnode)
  isVNodeString.value = isVNode('abc')
20
</script>