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