Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
DCloud
hello-uvue
提交
dc788d3d
H
hello-uvue
项目概览
DCloud
/
hello-uvue
通知
349
Star
2
Fork
7
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
1
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
H
hello-uvue
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
1
Issue
1
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
提交
dc788d3d
编写于
8月 13, 2024
作者:
DCloud-WZF
💬
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
refactor: 示例优化,移除条件编译
上级
7d773734
变更
6
显示空白变更内容
内联
并排
Showing
6 changed file
with
16 addition
and
53 deletion
+16
-53
pages/render-function/cloneVNode/cloneVNode-composition.uvue
pages/render-function/cloneVNode/cloneVNode-composition.uvue
+1
-6
pages/render-function/cloneVNode/cloneVNode-options.uvue
pages/render-function/cloneVNode/cloneVNode-options.uvue
+1
-6
pages/render-function/isVNode/isVNode-composition.uvue
pages/render-function/isVNode/isVNode-composition.uvue
+1
-6
pages/render-function/isVNode/isVNode-options.uvue
pages/render-function/isVNode/isVNode-options.uvue
+12
-18
pages/render-function/mergeProps/mergeProps-composition.uvue
pages/render-function/mergeProps/mergeProps-composition.uvue
+1
-9
pages/render-function/mergeProps/mergeProps-options.uvue
pages/render-function/mergeProps/mergeProps-options.uvue
+0
-8
未找到文件。
pages/render-function/cloneVNode/cloneVNode-composition.uvue
浏览文件 @
dc788d3d
...
...
@@ -4,12 +4,7 @@
const originalVNode = h('view', { class: 'original' }, [
h('text', {}, 'Hello World'),
])
// #ifdef APP-ANDROID
const clonedVNode = cloneVNode(originalVNode, new Map<string, any | null>([['class', 'cloned']]))
// #endif
// #ifdef WEB || APP-IOS
const clonedVNode = cloneVNode(originalVNode, { class: 'cloned'})
// #endif
const clonedVNode = cloneVNode(originalVNode, { class: 'cloned' })
return h('view', { class: 'flex flex-col' }, [originalVNode, clonedVNode])
}
...
...
pages/render-function/cloneVNode/cloneVNode-options.uvue
浏览文件 @
dc788d3d
...
...
@@ -4,12 +4,7 @@
const originalVNode = h('view', { class: 'original' }, [
h('text', {}, 'Hello World'),
])
// #ifdef APP-ANDROID
const clonedVNode = cloneVNode(originalVNode, new Map<string, any | null>([['class', 'cloned']]))
// #endif
// #ifdef WEB || APP-IOS
const clonedVNode = cloneVNode(originalVNode, { class: 'cloned'})
// #endif
const clonedVNode = cloneVNode(originalVNode, { class: 'cloned' })
return h('view', { class: 'flex flex-col' }, [originalVNode, clonedVNode])
}
...
...
pages/render-function/isVNode/isVNode-composition.uvue
浏览文件 @
dc788d3d
...
...
@@ -14,12 +14,7 @@
<script setup lang="uts">
const isVNodeVNode = ref(false)
const isVNodeString = ref(false)
// #ifdef APP-ANDROID
const vnode = h('text', new Map<string, any | null>(), 'Hello World')
// #endif
// #ifndef APP-ANDROID
const vnode = h('text', {}, 'Hello World')
// #endif
isVNodeVNode.value = isVNode(vnode)
isVNodeString.value = isVNode('abc')
</script>
\ No newline at end of file
pages/render-function/isVNode/isVNode-options.uvue
浏览文件 @
dc788d3d
...
...
@@ -12,23 +12,17 @@
</template>
<script lang="uts">
export default {
data()
{
export default {
data()
{
return {
isVNodeVNode: false,
isVNodeString: false
}
},
onLoad(){
// TODO: 确认 android 端与其他端差异
// #ifdef APP-ANDROID
const vnode = h('text', new Map<string, any | null>(), 'Hello World')
// #endif
// #ifndef APP-ANDROID
onLoad() {
const vnode = h('text', {}, 'Hello World')
// #endif
this.isVNodeVNode = isVNode(vnode)
this.isVNodeString = isVNode('abc')
}
}
}
</script>
\ No newline at end of file
pages/render-function/mergeProps/mergeProps-composition.uvue
浏览文件 @
dc788d3d
...
...
@@ -15,13 +15,6 @@
<script setup lang="uts">
type PropFn = () => string
// TODO: 确认 android 与 web & ios 差异
// #ifdef APP-ANDROID
const propA = new Map<string, any | null>([['class', 'foo'], ['onClick', () : string => 'propA click res']])
const propB = new Map<string, any | null>([['class', { bar: true }], ['onClick', () : string => 'propB click res']])
const mergedProps = ref(new Map<string, any | null>())
// #endif
// #ifndef APP-ANDROID
const propA = {
class: 'foo',
onClick: () : string => 'propA click res'
...
...
@@ -31,7 +24,6 @@
onClick: () : string => 'propB click res'
}
const mergedProps = ref({})
// #endif
const propFnResList = ref<string[]>([])
mergedProps.value = mergeProps(propA, propB)
...
...
pages/render-function/mergeProps/mergeProps-options.uvue
浏览文件 @
dc788d3d
...
...
@@ -17,13 +17,6 @@
export default {
data() {
return {
// TODO: 确认 android 与 web & ios 差异
// #ifdef APP-ANDROID
propA: new Map<string, any | null>([['class', 'foo'], ['onClick', () : string => 'propA click res']]),
propB: new Map<string, any | null>([['class', { bar: true }], ['onClick', () : string => 'propB click res']]),
mergedProps: new Map<string, any | null>(),
// #endif
// #ifndef APP-ANDROID
propA: {
class: 'foo',
onClick: () : string => 'propA click res'
...
...
@@ -33,7 +26,6 @@
onClick: () : string => 'propB click res'
},
mergedProps: {},
// #endif
propFnResList: [] as string[],
}
},
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录