Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
DCloud
hello-uvue
提交
4865f64b
H
hello-uvue
项目概览
DCloud
/
hello-uvue
通知
350
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看板
提交
4865f64b
编写于
8月 13, 2024
作者:
DCloud-WZF
💬
浏览文件
操作
浏览文件
下载
差异文件
Merge branch 'dev' into alpha
上级
1a137d4c
9dc66aae
变更
14
隐藏空白更改
内联
并排
Showing
14 changed file
with
26 addition
and
115 deletion
+26
-115
main.uts
main.uts
+4
-4
pages/component-instance/attrs/child-composition.uvue
pages/component-instance/attrs/child-composition.uvue
+3
-18
pages/component-instance/attrs/child-options.uvue
pages/component-instance/attrs/child-options.uvue
+3
-18
pages/component-instance/parent/child-composition.uvue
pages/component-instance/parent/child-composition.uvue
+0
-5
pages/component-instance/parent/child-options.uvue
pages/component-instance/parent/child-options.uvue
+0
-5
pages/component-instance/parent/parent-composition.uvue
pages/component-instance/parent/parent-composition.uvue
+0
-5
pages/component-instance/parent/parent-options.uvue
pages/component-instance/parent/parent-options.uvue
+0
-5
pages/reactivity/core/readonly/readonly.uvue
pages/reactivity/core/readonly/readonly.uvue
+0
-2
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
未找到文件。
main.uts
浏览文件 @
4865f64b
...
...
@@ -267,13 +267,13 @@ export function createApp() {
app.use(plugin2)
app.use(plugin3)
app.use(plugin4)
app.use(function (app: VueApp, componentName: string
, componentInstance: CreateVueComponent
) {
app.component(componentName,
componentInstance
)
}, 'CompForPlugin1'
, CompForPlugin
)
app.use(function (app: VueApp, componentName: string) {
app.component(componentName,
CompForPlugin
)
}, 'CompForPlugin1')
app.use({
install(app: VueApp, a: string | null, b: string | null) {
app.component('CompForPlugin2', CompForPlugin
as CreateVueComponent
)
app.component('CompForPlugin2', CompForPlugin)
}
}, null, null)
...
...
pages/component-instance/attrs/child-composition.uvue
浏览文件 @
4865f64b
...
...
@@ -28,29 +28,14 @@ defineProps({
const attrs = useAttrs()
const hasPropsAttr = computed(():boolean => {
// #ifdef APP-ANDROID
return attrs.has('val')
// #endif
// #ifndef APP-ANDROID
return !!attrs['val']
// #endif
return attrs['val'] != null
})
const hasEmitsAttr = computed(():boolean => {
// #ifdef APP-ANDROID
return attrs.has('childClick')
// #endif
// #ifndef APP-ANDROID
return !!attrs['childClick']
// #endif
return attrs['childClick'] != null
})
const hasClassAttr = computed(():boolean => {
// #ifdef APP-ANDROID
return attrs.has('class')
// #endif
// #ifndef APP-ANDROID
return !!attrs['class']
// #endif
return attrs['class'] != null
})
</script>
pages/component-instance/attrs/child-options.uvue
浏览文件 @
4865f64b
...
...
@@ -26,28 +26,13 @@ export default {
},
computed: {
hasPropsAttr(): boolean {
// #ifdef APP-ANDROID
return this.$attrs.has('val')
// #endif
// #ifndef APP-ANDROID
return !!this.$attrs['val']
// #endif
return this.$attrs['val'] != null
},
hasEmitsAttr(): boolean {
// #ifdef APP-ANDROID
return this.$attrs.has('childClick')
// #endif
// #ifndef APP-ANDROID
return !!this.$attrs['childClick']
// #endif
return this.$attrs['childClick'] != null
},
hasClassAttr(): boolean {
// #ifdef APP-ANDROID
return this.$attrs.has('class')
// #endif
// #ifndef APP-ANDROID
return !!this.$attrs['class']
// #endif
return this.$attrs['class'] != null
}
}
}
...
...
pages/component-instance/parent/child-composition.uvue
浏览文件 @
4865f64b
...
...
@@ -30,11 +30,6 @@
})
const triggerParentFn = () => {
// #ifdef APP-ANDROID || WEB
parentNum.value = instance.$parent!.$callMethod('callMethodByChild') as number
// #endif
// #ifndef APP-ANDROID || WEB
parentNum.value = instance.$parent!['callMethodByChild']()
// #endif
}
</script>
\ No newline at end of file
pages/component-instance/parent/child-options.uvue
浏览文件 @
4865f64b
...
...
@@ -27,12 +27,7 @@
},
methods: {
triggerParentFn() {
// #ifdef APP-ANDROID || WEB
this.parentNum = this.$parent!.$callMethod('callMethodByChild') as number
// #endif
// #ifndef APP-ANDROID || WEB
this.parentNum = this.$parent!['callMethodByChild']()
// #endif
}
}
}
...
...
pages/component-instance/parent/parent-composition.uvue
浏览文件 @
4865f64b
...
...
@@ -17,12 +17,7 @@
const callMethodByChild = () : number => {
const childComponent = instance.$refs['childRef'] as ComponentPublicInstance
// #ifdef APP-ANDROID
return childComponent.$parent!.$callMethod('getNum') as number
// #endif
// #ifndef APP-ANDROID
return childComponent.$parent!['getNum']()
// #endif
}
defineExpose({
...
...
pages/component-instance/parent/parent-options.uvue
浏览文件 @
4865f64b
...
...
@@ -23,12 +23,7 @@ export default {
},
callMethodByChild(): number {
const child = this.$refs['child'] as ComponentPublicInstance
// #ifdef APP-ANDROID
return child.$parent!.$callMethod('getNum') as number
// #endif
// #ifndef APP-ANDROID
return child.$parent!['getNum']()
// #endif
}
}
}
...
...
pages/reactivity/core/readonly/readonly.uvue
浏览文件 @
4865f64b
...
...
@@ -56,10 +56,8 @@ const updateData = () => {
}
const updateReadonlyData = () => {
// #ifndef WEB
readonlyData.str = 'new readonly str'
readonlyData.num++
readonlyData.arr.push('e')
// #endif
}
</script>
pages/render-function/cloneVNode/cloneVNode-composition.uvue
浏览文件 @
4865f64b
...
...
@@ -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
浏览文件 @
4865f64b
...
...
@@ -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
浏览文件 @
4865f64b
...
...
@@ -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>
</script>
\ No newline at end of file
pages/render-function/isVNode/isVNode-options.uvue
浏览文件 @
4865f64b
...
...
@@ -12,23 +12,17 @@
</template>
<script lang="uts">
export default {
data(){
return {
isVNodeVNode: false,
isVNodeString: false
export default {
data() {
return {
isVNodeVNode: false,
isVNodeString: false
}
},
onLoad() {
const vnode = h('text', {}, 'Hello World')
this.isVNodeVNode = isVNode(vnode)
this.isVNodeString = isVNode('abc')
}
},
onLoad(){
// TODO: 确认 android 端与其他端差异
// #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
this.isVNodeVNode = isVNode(vnode)
this.isVNodeString = isVNode('abc')
}
}
</script>
</script>
\ No newline at end of file
pages/render-function/mergeProps/mergeProps-composition.uvue
浏览文件 @
4865f64b
...
...
@@ -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,11 +24,10 @@
onClick: () : string => 'propB click res'
}
const mergedProps = ref({})
// #endif
const propFnResList = ref<string[]>([])
mergedProps.value = mergeProps(propA, propB)
const triggerMergedClick = () => {
(mergedProps.value['onClick'] as PropFn[]).forEach(fn => { propFnResList.value.push(fn()) })
}
...
...
pages/render-function/mergeProps/mergeProps-options.uvue
浏览文件 @
4865f64b
...
...
@@ -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.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录