Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
DCloud
hello-uvue
提交
653a0093
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看板
提交
653a0093
编写于
8个月前
作者:
DCloud-WZF
💬
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
refactor(reactivity): isReactive
上级
055c16c0
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
59 addition
and
32 deletion
+59
-32
pages/index/index.uvue
pages/index/index.uvue
+5
-0
pages/reactivity/utilities/is-reactive/is-reactive.test.js
pages/reactivity/utilities/is-reactive/is-reactive.test.js
+7
-7
pages/reactivity/utilities/is-reactive/is-reactive.uvue
pages/reactivity/utilities/is-reactive/is-reactive.uvue
+46
-24
refactor_options-API-composition-API-correspondence.md
refactor_options-API-composition-API-correspondence.md
+1
-1
未找到文件。
pages/index/index.uvue
浏览文件 @
653a0093
...
...
@@ -533,6 +533,11 @@ export default {
name: 'isProxy',
url: 'is-proxy/is-proxy'
},
{
id: 'is-reactive',
name: 'isReactive',
url: 'is-reactive/is-reactive'
},
]
}
] as Page[]
...
...
This diff is collapsed.
Click to expand it.
pages/reactivity/utilities/is-reactive/is-reactive.test.js
浏览文件 @
653a0093
const
PAGE_PATH
=
'
/pages/
composition-api/reactivity
/is-reactive/is-reactive
'
const
PAGE_PATH
=
'
/pages/
reactivity/utilities
/is-reactive/is-reactive
'
describe
(
'
isReactive
'
,
()
=>
{
let
page
=
null
...
...
@@ -8,21 +8,21 @@ describe('isReactive', () => {
})
it
(
'
basic
'
,
async
()
=>
{
const
isReactiveCount
=
await
page
.
$
(
'
#is-reactive-count
'
)
expect
(
await
isReactiveCount
.
text
()).
toBe
(
'
isReactive(count):
false
'
)
expect
(
await
isReactiveCount
.
text
()).
toBe
(
'
false
'
)
const
isReactiveRefCount
=
await
page
.
$
(
'
#is-reactive-ref-count
'
)
expect
(
await
isReactiveRefCount
.
text
()).
toBe
(
'
isReactive(refCount):
false
'
)
expect
(
await
isReactiveRefCount
.
text
()).
toBe
(
'
false
'
)
const
isReactiveReactiveCount
=
await
page
.
$
(
'
#is-reactive-reactive-count
'
)
expect
(
await
isReactiveReactiveCount
.
text
()).
toBe
(
'
isReactive(reactiveCount):
true
'
)
expect
(
await
isReactiveReactiveCount
.
text
()).
toBe
(
'
true
'
)
const
isReactiveReadonlyCount
=
await
page
.
$
(
'
#is-reactive-readonly-count
'
)
expect
(
await
isReactiveReadonlyCount
.
text
()).
toBe
(
'
isReactive(readonlyCount):
false
'
)
expect
(
await
isReactiveReadonlyCount
.
text
()).
toBe
(
'
false
'
)
const
isReactiveShallowReactiveCount
=
await
page
.
$
(
'
#is-reactive-shallow-reactive-count
'
)
expect
(
await
isReactiveShallowReactiveCount
.
text
()).
toBe
(
'
isReactive(shallowReactiveCount):
true
'
)
expect
(
await
isReactiveShallowReactiveCount
.
text
()).
toBe
(
'
true
'
)
const
isReactiveShallowReadonlyCount
=
await
page
.
$
(
'
#is-reactive-shallow-readonly-count
'
)
expect
(
await
isReactiveShallowReadonlyCount
.
text
()).
toBe
(
'
isReactive(shallowReadonlyCount):
false
'
)
expect
(
await
isReactiveShallowReadonlyCount
.
text
()).
toBe
(
'
false
'
)
})
})
\ No newline at end of file
This diff is collapsed.
Click to expand it.
pages/reactivity/utilities/is-reactive/is-reactive.uvue
浏览文件 @
653a0093
<template>
<view class="page">
<text id="is-reactive-count">isReactive(count): {{ isProxyCount }}</text>
<text class="mt-10" id="is-reactive-ref-count">isReactive(refCount): {{ isProxyRefCount }}</text>
<text class="mt-10" id="is-reactive-reactive-count">isReactive(reactiveCount):
{{ isProxyReactiveCount }}</text>
<text class="mt-10" id="is-reactive-readonly-count">isReactive(readonlyCount):
{{ isProxyReadonlyCount }}</text>
<text class="mt-10" id="is-reactive-shallow-reactive-count">isReactive(shallowReactiveCount):
{{ isProxyShallowReactiveCount }}</text>
<text class="mt-10" id="is-reactive-shallow-readonly-count">isReactive(shallowReadonlyCount):
{{ isProxyShallowReadonlyCount }}</text>
<view class="flex justify-between flex-row mb-10">
<text>isReactive(count):</text>
<text id="is-reactive-count">{{ isReactiveCount }}</text>
</view>
<view class="flex justify-between flex-row mb-10">
<text>isReactive(count):</text>
<text id="is-reactive-count">{{ isReactiveCount }}</text>
</view>
<view class="flex justify-between flex-row mb-10">
<text>isReactive(refCount):</text>
<text id="is-reactive-ref-count">{{ isReactiveRefCount }}</text>
</view>
<view class="flex justify-between flex-row mb-10">
<text>isReactive(reactiveCount):</text>
<text id="is-reactive-reactive-count">{{ isReactiveReactiveCount }}</text>
</view>
<view class="flex justify-between flex-row mb-10">
<text>isReactive(readonlyCount):</text>
<text id="is-reactive-readonly-count">{{ isReactiveReadonlyCount }}</text>
</view>
<view class="flex justify-between flex-row mb-10">
<text>isReactive(shallowReactiveCount):</text>
<text id="is-reactive-shallow-reactive-count">{{
isReactiveShallowReactiveCount
}}</text>
</view>
<view class="flex justify-between flex-row mb-10">
<text>isReactive(shallowReadonlyCount):</text>
<text id="is-reactive-shallow-readonly-count">{{
isReactiveShallowReadonlyCount
}}</text>
</view>
</view>
</template>
<script setup>
const count = 0;
const isProxy
Count = isReactive(count);
<script setup
lang="uts"
>
const count = 0;
const isReactive
Count = isReactive(count);
const refCount = ref(0);
const isProxy
RefCount = isReactive(refCount);
const refCount = ref(0);
const isReactive
RefCount = isReactive(refCount);
const reactiveCount = reactive({ count: 0 });
const isProxy
ReactiveCount = isReactive(reactiveCount);
const reactiveCount = reactive({ count: 0 });
const isReactive
ReactiveCount = isReactive(reactiveCount);
const readonlyCount = readonly({ count: 0 });
const isProxy
ReadonlyCount = isReactive(readonlyCount);
const readonlyCount = readonly({ count: 0 });
const isReactive
ReadonlyCount = isReactive(readonlyCount);
const shallowReactiveCount = shallowReactive({ count: 0 });
const isProxy
ShallowReactiveCount = isReactive(shallowReactiveCount);
const shallowReactiveCount = shallowReactive({ count: 0 });
const isReactive
ShallowReactiveCount = isReactive(shallowReactiveCount);
const shallowReadonlyCount = shallowReadonly({ count: 0 });
const isProxyShallowReadonlyCount = isReactive(shallowReadonlyCount);
</script>
\ No newline at end of file
const shallowReadonlyCount = shallowReadonly({ count: 0 });
const isReactiveShallowReadonlyCount = isReactive(shallowReadonlyCount);
</script>
This diff is collapsed.
Click to expand it.
refactor_options-API-composition-API-correspondence.md
浏览文件 @
653a0093
...
...
@@ -132,7 +132,7 @@ function transform(fileInfo, api) {
-
[x] readonly
-
[x] isProxy
-
[
] is-r
eactive
-
[
x] isR
eactive
-
[ ] isReadonly
-
[ ] isRef
-
[ ] toRef
...
...
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.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录
新手
引导
客服
返回
顶部