diff --git a/pages.json b/pages.json
index 9fad6a95a7254135606af9a191f9e1684b96dbc9..fa156702e30ec78960058cae9363c5e963dbc18b 100644
--- a/pages.json
+++ b/pages.json
@@ -419,6 +419,26 @@
"navigationBarTitleText": "call-method-other 组合式 API"
}
},
+ {
+ "path": "pages/component-instance/provide/provide-options-1",
+ "style": {
+ "navigationBarTitleText": "provide 选项式 API 字面量"
+ }
+ },
+ {
+ "path": "pages/component-instance/provide/provide-options-2",
+ "style": {
+ "navigationBarTitleText": "provide 选项式 API 函数"
+ }
+ },
+ {
+ "path": "pages/component-instance/provide/provide-composition",
+ "style": {
+ "navigationBarTitleText": "provide 组合式 API"
+ }
+ },
+
+
{
"path": "pages/component-instance/circular-reference/circular-reference",
"style": {
@@ -537,24 +557,6 @@
}
},
// #endif
- {
- "path": "pages/composition/provide/provide",
- "style": {
- "navigationBarTitleText": "provide"
- }
- },
- {
- "path": "pages/composition/provide/provide-page2",
- "style": {
- "navigationBarTitleText": "provide-page-2"
- }
- },
- {
- "path": "pages/composition/inject/inject",
- "style": {
- "navigationBarTitleText": "inject"
- }
- },
{
"path": "pages/composition/setup/setup",
"style": {
@@ -791,12 +793,6 @@
"navigationBarTitleText": "onScopeDispose"
}
},
- {
- "path": "pages/composition-api/dependency-injection/provide/provide",
- "style": {
- "navigationBarTitleText": "依赖注入"
- }
- },
{
"path": "pages/built-in/component/teleport/teleport-options",
"style": {
diff --git a/pages/component-instance/inject/inject-composition.uvue b/pages/component-instance/inject/inject-composition.uvue
new file mode 100644
index 0000000000000000000000000000000000000000..f5e3646ddea80cfeb44503564ec63c6baa3e39c1
--- /dev/null
+++ b/pages/component-instance/inject/inject-composition.uvue
@@ -0,0 +1,32 @@
+
+
+ inject page
+ msg: {{msg}}
+ num: {{num}}
+ obj: {{JSON.stringify(obj)}}
+ arr: {{JSON.stringify(arr)}}
+ fn: {{(fn as () => string)()}}
+ hasInjectionContext:
+ {{checkHasInjectionContextRes}}
+
+
+
+
+
\ No newline at end of file
diff --git a/pages/composition/provide/component-for-inject-1.uvue b/pages/component-instance/inject/inject-options-1.uvue
similarity index 79%
rename from pages/composition/provide/component-for-inject-1.uvue
rename to pages/component-instance/inject/inject-options-1.uvue
index 17e132b9a09e2ea2952510d02cd319f061e6d347..0657dec6c3920ccf75a91ebebf5f467a9a88c2d8 100644
--- a/pages/composition/provide/component-for-inject-1.uvue
+++ b/pages/component-instance/inject/inject-options-1.uvue
@@ -1,41 +1,41 @@
- component for inject 1
- component for inject 1
+ aliasProvidePageTitle: {{ aliasProvidePageTitle }}
- providePageStr: {{ providePageStr }}
- providePageNum: {{ providePageNum }}
- providePageBool: {{ providePageBool }}
- providePageObject.title: {{ providePageObject['title'] }}
- providePageObject.content: {{ providePageObject['content'] }}
- providePageArr: {{ JSON.stringify(providePageArr) }}
- providePageMap: {{ JSON.stringify(providePageMapObj) }}
- providePageSet: {{ JSON.stringify(providePageSetArr) }}
- testInjectStringDefaultValue: {{ testInjectStringDefaultValue }}
- testInjectObjectDefaultValue.title:
{{ testInjectObjectDefaultValue['title'] }}
- testInjectObjectDefaultValue.content:
{{ testInjectObjectDefaultValue['content'] }}
diff --git a/pages/composition/provide/component-for-inject-2.uvue b/pages/component-instance/inject/inject-options-2.uvue
similarity index 67%
rename from pages/composition/provide/component-for-inject-2.uvue
rename to pages/component-instance/inject/inject-options-2.uvue
index 67635474b3e8790d45782c839f5d0513d9c5aef6..4a817f874129b3686e1d018e2763b36041c6a3cc 100644
--- a/pages/composition/provide/component-for-inject-2.uvue
+++ b/pages/component-instance/inject/inject-options-2.uvue
@@ -1,21 +1,21 @@
- component for inject 2
- component for inject 2
+ providePageTitle: {{ providePageTitle }}
- providePageStr: {{ providePageStr }}
- providePageNum: {{ providePageNum }}
- providePageBool: {{ providePageBool }}
- providePageStr: {{ providePageStr }}
+ providePageNum: {{ providePageNum }}
+ providePageBool: {{ providePageBool }}
+ providePageObject.title: {{ providePageObject['title'] }}
- providePageObject.content: {{ providePageObject['content'] }}
- providePageArr: {{ JSON.stringify(providePageArr) }}
- providePageMap: {{ JSON.stringify(providePageMapObj) }}
- providePageSet: {{ JSON.stringify(providePageSetArr) }}
+ providePageArr: {{ JSON.stringify(providePageArr) }}
+ providePageMap: {{ JSON.stringify(providePageMapObj) }}
+ providePageSet: {{ JSON.stringify(providePageSetArr) }}
diff --git a/pages/composition-api/dependency-injection/provide/provide-inject.test.js b/pages/component-instance/provide/provide-composition.test.js
similarity index 85%
rename from pages/composition-api/dependency-injection/provide/provide-inject.test.js
rename to pages/component-instance/provide/provide-composition.test.js
index 6e71429ac6e84f4605b80fd2bb1622978f5245c1..2f698859ef3445cf40b3bd79337cf9e7b287143f 100644
--- a/pages/composition-api/dependency-injection/provide/provide-inject.test.js
+++ b/pages/component-instance/provide/provide-composition.test.js
@@ -1,6 +1,6 @@
-const PAGE_PATH = '/pages/composition-api/dependency-injection/provide/provide'
+const PAGE_PATH = '/pages/component-instance/provide/provide-composition'
-describe('provide-inject-hasInjectionContext', () => {
+describe('组合式 API provide', () => {
let page = null
beforeAll(async () => {
page = await program.reLaunch(PAGE_PATH)
diff --git a/pages/component-instance/provide/provide-composition.uvue b/pages/component-instance/provide/provide-composition.uvue
new file mode 100644
index 0000000000000000000000000000000000000000..9582bab16b803a40a79c82bb444eb04aec1199eb
--- /dev/null
+++ b/pages/component-instance/provide/provide-composition.uvue
@@ -0,0 +1,15 @@
+
+
+
+
+
+
+
diff --git a/pages/composition/provide/provide.test.js b/pages/component-instance/provide/provide-options-1.test.js
similarity index 93%
rename from pages/composition/provide/provide.test.js
rename to pages/component-instance/provide/provide-options-1.test.js
index 9044e86ce6102ff1004ce2bcd993db55a5a18316..c0d7cd32c985ee08cf31423248dedaaaa59d4f97 100644
--- a/pages/composition/provide/provide.test.js
+++ b/pages/component-instance/provide/provide-options-1.test.js
@@ -1,5 +1,8 @@
-const PAGE_PATH = '/pages/composition/provide/provide'
-describe('字面量方式创建 provide', () => {
+jest.setTimeout(20000)
+
+const PAGE_PATH = '/pages/component-instance/provide/provide-options-1'
+
+describe('选项式 API 字面量方式创建 provide', () => {
let page
beforeAll(async () => {
page = await program.reLaunch(PAGE_PATH)
diff --git a/pages/composition/provide/provide.uvue b/pages/component-instance/provide/provide-options-1.uvue
similarity index 89%
rename from pages/composition/provide/provide.uvue
rename to pages/component-instance/provide/provide-options-1.uvue
index 15e62945fed921ec53e4170c3388cc4bed331fc2..2cf91fe699be6a864bc4c0b36264a92500113f1e 100644
--- a/pages/composition/provide/provide.uvue
+++ b/pages/component-instance/provide/provide-options-1.uvue
@@ -4,7 +4,7 @@
provide page
-
\ No newline at end of file
diff --git a/pages/composition-api/dependency-injection/provide/provide.uvue b/pages/composition-api/dependency-injection/provide/provide.uvue
deleted file mode 100644
index 4022ed0f5f8d0994312a2928c917c3470cd837c4..0000000000000000000000000000000000000000
--- a/pages/composition-api/dependency-injection/provide/provide.uvue
+++ /dev/null
@@ -1,15 +0,0 @@
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/pages/composition/inject/inject.test.js b/pages/composition/inject/inject.test.js
deleted file mode 100644
index 01bc3edb6f940e3047924b9d0b1d21da7bc25d28..0000000000000000000000000000000000000000
--- a/pages/composition/inject/inject.test.js
+++ /dev/null
@@ -1,13 +0,0 @@
-const PAGE_PATH = '/pages/composition/inject/inject'
-
-describe('inject', () => {
- it('basic', async () => {
- const page = await program.reLaunch(PAGE_PATH)
- await page.waitFor('view')
- const globalProvideMsgEl = await page.$('.global-provide-msg')
- const globalProvideMsgElText = await globalProvideMsgEl.text()
- expect(globalProvideMsgElText).toBe(
- 'globalProvideMsg: global provide message'
- )
- })
-})
diff --git a/pages/composition/inject/inject.uvue b/pages/composition/inject/inject.uvue
deleted file mode 100644
index 1db77431c3cf4624fcf185b0a9356792ba6f01fc..0000000000000000000000000000000000000000
--- a/pages/composition/inject/inject.uvue
+++ /dev/null
@@ -1,12 +0,0 @@
-
-
- inject page
- globalProvideMsg: {{globalProvideMsg}}
-
-
-
-
diff --git a/pages/index/index.uvue b/pages/index/index.uvue
index b7834aab2916f95e66f507a80654f77dfba44970..a195434bf152b591c512759d1075feeca74c07b1 100644
--- a/pages/index/index.uvue
+++ b/pages/index/index.uvue
@@ -331,6 +331,27 @@ export default {
url: 'call-method-other-composition'
}
]
+ },
+ {
+ id: 'provide',
+ name: 'provide',
+ children: [
+ {
+ id: 'provide-options-1',
+ name: 'provide 选项式 API 字面量方式',
+ url: 'provide-options-1'
+ },
+ {
+ id: 'provide-options-2',
+ name: 'provide 选项式 API 函数方式',
+ url: 'provide-options-2'
+ },
+ {
+ id: 'provide-composition',
+ name: 'provide 组合式 API',
+ url: 'provide-composition'
+ },
+ ]
}
] as Page[]
},