提交 6448b959 编写于 作者: F fxy060608

feat: 增加 h 函数第二个参数为 UTSJSONObject 的测试

上级 c69a7d16
...@@ -2,10 +2,11 @@ ...@@ -2,10 +2,11 @@
import CompForHFunction from '@/components/CompForHFunction.uvue' import CompForHFunction from '@/components/CompForHFunction.uvue'
const msg = ref('default msg') const msg = ref('default msg')
// 故意外部声明为UTSJSONObject
const msgProps = { class: 'uni-common-mt msg', style: { color: 'blue' } }
const render = ():VNode => h('view', { class: 'page' }, [ const render = ():VNode => h('view', { class: 'page' }, [
h(CompForHFunction, {}, (): VNode[] => [h('text', { class: 'comp-slot' }, 'component slot')]), h(CompForHFunction, {}, (): VNode[] => [h('text', { class: 'comp-slot' }, 'component slot')]),
h('text', { class: 'uni-common-mt msg', style: { color: 'blue' } }, msg.value), h('text', msgProps, msg.value),
h( h(
'button', 'button',
{ {
......
<script lang="uts"> <script lang="uts">
import CompForHFunction from '@/components/CompForHFunction.uvue' import CompForHFunction from '@/components/CompForHFunction.uvue'
// 故意外部声明为UTSJSONObject
const msgProps = { class: 'uni-common-mt msg', style: { color: 'blue' } }
export default { export default {
data() { data() {
return { return {
...@@ -9,7 +11,7 @@ export default { ...@@ -9,7 +11,7 @@ export default {
render(): VNode { render(): VNode {
return h('view', { class: 'page' }, [ return h('view', { class: 'page' }, [
h(CompForHFunction, {}, (): VNode[] => [h('text', { class: 'comp-slot' }, 'component slot')]), h(CompForHFunction, {}, (): VNode[] => [h('text', { class: 'comp-slot' }, 'component slot')]),
h('text', { class: 'uni-common-mt msg', style: { color: 'blue' } }, this.msg), h('text', msgProps, this.msg),
h( h(
'button', 'button',
{ {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册