Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
DCloud
hello-uvue
提交
055c16c0
H
hello-uvue
项目概览
DCloud
/
hello-uvue
通知
361
Star
3
Fork
8
代码
文件
提交
分支
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看板
提交
055c16c0
编写于
8个月前
作者:
DCloud-WZF
💬
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
refactor(reactivity): isProxy
上级
9e44579e
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
77 addition
and
35 deletion
+77
-35
pages/index/index.uvue
pages/index/index.uvue
+11
-0
pages/reactivity/utilities/is-proxy/is-proxy.test.js
pages/reactivity/utilities/is-proxy/is-proxy.test.js
+9
-7
pages/reactivity/utilities/is-proxy/is-proxy.uvue
pages/reactivity/utilities/is-proxy/is-proxy.uvue
+46
-20
refactor_options-API-composition-API-correspondence.md
refactor_options-API-composition-API-correspondence.md
+11
-8
未找到文件。
pages/index/index.uvue
浏览文件 @
055c16c0
...
...
@@ -523,6 +523,17 @@ export default {
url: 'watch-sync-effect/watch-sync-effect'
},
]
},
{
id: 'utilities',
name: '工具',
children: [
{
id: 'is-proxy',
name: 'isProxy',
url: 'is-proxy/is-proxy'
},
]
}
] as Page[]
},
...
...
This diff is collapsed.
Click to expand it.
pages/reactivity/utilities/is-proxy/is-proxy.test.js
浏览文件 @
055c16c0
const
PAGE_PATH
=
'
/pages/
composition-api/reactivity
/is-proxy/is-proxy
'
const
PAGE_PATH
=
'
/pages/
reactivity/utilities
/is-proxy/is-proxy
'
describe
(
'
isProxy
'
,
()
=>
{
let
page
=
null
beforeAll
(
async
()
=>
{
page
=
await
program
.
reLaunch
(
PAGE_PATH
)
await
page
.
waitFor
(
'
view
'
)
})
it
(
'
basic
'
,
async
()
=>
{
const
isProxyCount
=
await
page
.
$
(
'
#is-proxy-count
'
)
expect
(
await
isProxyCount
.
text
()).
toBe
(
'
isProxy(count):
false
'
)
expect
(
await
isProxyCount
.
text
()).
toBe
(
'
false
'
)
const
isProxyRefCount
=
await
page
.
$
(
'
#is-proxy-ref-count
'
)
expect
(
await
isProxyRefCount
.
text
()).
toBe
(
'
isProxy(refCount):
false
'
)
expect
(
await
isProxyRefCount
.
text
()).
toBe
(
'
false
'
)
const
isProxyReactiveCount
=
await
page
.
$
(
'
#is-proxy-reactive-count
'
)
expect
(
await
isProxyReactiveCount
.
text
()).
toBe
(
'
isProxy(reactiveCount):
true
'
)
expect
(
await
isProxyReactiveCount
.
text
()).
toBe
(
'
true
'
)
const
isProxyReadonlyCount
=
await
page
.
$
(
'
#is-proxy-readonly-count
'
)
expect
(
await
isProxyReadonlyCount
.
text
()).
toBe
(
'
isProxy(readonlyCount):
true
'
)
expect
(
await
isProxyReadonlyCount
.
text
()).
toBe
(
'
true
'
)
const
isProxyShallowReactiveCount
=
await
page
.
$
(
'
#is-proxy-shallow-reactive-count
'
)
expect
(
await
isProxyShallowReactiveCount
.
text
()).
toBe
(
'
isProxy(shallowReactiveCount):
true
'
)
expect
(
await
isProxyShallowReactiveCount
.
text
()).
toBe
(
'
true
'
)
const
isProxyShallowReadonlyCount
=
await
page
.
$
(
'
#is-proxy-shallow-readonly-count
'
)
expect
(
await
isProxyShallowReadonlyCount
.
text
()).
toBe
(
'
isProxy(shallowReadonlyCount):
true
'
)
expect
(
await
isProxyShallowReadonlyCount
.
text
()).
toBe
(
'
true
'
)
})
})
\ No newline at end of file
This diff is collapsed.
Click to expand it.
pages/reactivity/utilities/is-proxy/is-proxy.uvue
浏览文件 @
055c16c0
<template>
<view class="page">
<text id="is-proxy-count">isProxy(count): {{ isProxyCount }}</text>
<text class="mt-10" id="is-proxy-ref-count">isProxy(refCount): {{ isProxyRefCount }}</text>
<text class="mt-10" id="is-proxy-reactive-count">isProxy(reactiveCount): {{ isProxyReactiveCount }}</text>
<text class="mt-10" id="is-proxy-readonly-count">isProxy(readonlyCount): {{ isProxyReadonlyCount }}</text>
<text class="mt-10" id="is-proxy-shallow-reactive-count">isProxy(shallowReactiveCount): {{ isProxyShallowReactiveCount }}</text>
<text class="mt-10" id="is-proxy-shallow-readonly-count">isProxy(shallowReadonlyCount): {{ isProxyShallowReadonlyCount }}</text>
<view class="flex justify-between flex-row mb-10">
<text>isProxy(count):</text>
<text id="is-proxy-count">{{ isProxyCount }}</text>
</view>
<view class="flex justify-between flex-row mb-10">
<text>isProxy(count):</text>
<text id="is-proxy-count">{{ isProxyCount }}</text>
</view>
<view class="flex justify-between flex-row mb-10">
<text>isProxy(refCount):</text>
<text id="is-proxy-ref-count">{{ isProxyRefCount }}</text>
</view>
<view class="flex justify-between flex-row mb-10">
<text>isProxy(reactiveCount):</text>
<text id="is-proxy-reactive-count">{{ isProxyReactiveCount }}</text>
</view>
<view class="flex justify-between flex-row mb-10">
<text>isProxy(readonlyCount):</text>
<text id="is-proxy-readonly-count">{{ isProxyReadonlyCount }}</text>
</view>
<view class="flex justify-between flex-row mb-10">
<text>isProxy(shallowReactiveCount):</text>
<text id="is-proxy-shallow-reactive-count">{{
isProxyShallowReactiveCount
}}</text>
</view>
<view class="flex justify-between flex-row mb-10">
<text>isProxy(shallowReadonlyCount):</text>
<text id="is-proxy-shallow-readonly-count">{{
isProxyShallowReadonlyCount
}}</text>
</view>
</view>
</template>
<script setup>
const count = 0;
const isProxyCount = isProxy(count);
<script setup
lang="uts"
>
const count = 0;
const isProxyCount = isProxy(count);
const refCount = ref(0);
const isProxyRefCount = isProxy(refCount);
const refCount = ref(0);
const isProxyRefCount = isProxy(refCount);
const reactiveCount = reactive({ count: 0 });
const isProxyReactiveCount = isProxy(reactiveCount);
const reactiveCount = reactive({ count: 0 });
const isProxyReactiveCount = isProxy(reactiveCount);
const readonlyCount = readonly({ count: 0 });
const isProxyReadonlyCount = isProxy(readonlyCount);
const readonlyCount = readonly({ count: 0 });
const isProxyReadonlyCount = isProxy(readonlyCount);
const shallowReactiveCount = shallowReactive({ count: 0 });
const isProxyShallowReactiveCount = isProxy(shallowReactiveCount);
const shallowReactiveCount = shallowReactive({ count: 0 });
const isProxyShallowReactiveCount = isProxy(shallowReactiveCount);
const shallowReadonlyCount = shallowReadonly({ count: 0 });
const isProxyShallowReadonlyCount = isProxy(shallowReadonlyCount);
</script>
\ No newline at end of file
const shallowReadonlyCount = shallowReadonly({ count: 0 });
const isProxyShallowReadonlyCount = isProxy(shallowReadonlyCount);
</script>
This diff is collapsed.
Click to expand it.
refactor_options-API-composition-API-correspondence.md
浏览文件 @
055c16c0
...
...
@@ -129,24 +129,27 @@ function transform(fileInfo, api) {
-
[x] watchEffect
-
[x] watchPostEffect
-
[x] watchSyncEffect
-
[ ] readonly
-
[x] readonly
-
[x] isProxy
-
[ ] is-reactive
-
[ ] isReadonly
-
[ ] isRef
-
[ ] toRef
-
[ ] toRefs
-
[ ] toValue
-
[ ] unRef
-
[ ] customRef
-
[ ] effectScope
-
[ ] getCurrentScope
-
[ ] isProxy
-
[ ] isReadonly
-
[ ] isRef
-
[ ] markRaw
-
[ ] onScopeDispose
-
[ ] shallowReactive
-
[ ] shallowReadonly
-
[ ] shallowRef
-
[ ] toRaw
-
[ ] toRef
-
[ ] toRefs
-
[ ] toValue
-
[ ] triggerRef
-
[ ] unRef
## directives
...
...
This diff is collapsed.
Click to expand it.
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录
新手
引导
客服
返回
顶部