docs(pages): pages使用增加说明
This commit is contained in:
parent
83e19e8eb2
commit
f101449b3c
@ -1,8 +1,18 @@
|
|||||||
<template>
|
<template>
|
||||||
<view>
|
<view>
|
||||||
<view>demo</view>
|
<view>demo</view>
|
||||||
<view>测试是否会自动引入到pages,发现会</view>
|
<view>测试是否会自动引入到pages,发现会,除非增加exclude配置</view>
|
||||||
<view>说明components里面的vue文件也会注册为page,这个特性感觉不太好</view>
|
<view>需要在vite.config.ts(注意不是pages.config.ts)中UniPages()配置exclude</view>
|
||||||
<view>我已经在pages.config.ts里面配置了exclude,但是没生效</view>
|
<view>配置如下: </view>
|
||||||
|
<pre>
|
||||||
|
export default defineConfig({
|
||||||
|
plugins: [
|
||||||
|
UniPages({
|
||||||
|
exclude: ['**/components/**/**.*'],
|
||||||
|
}),
|
||||||
|
uni(),
|
||||||
|
],
|
||||||
|
})
|
||||||
|
</pre>
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
|
@ -27,6 +27,7 @@
|
|||||||
<navigator url="/pages/my/index" open-type="navigate" hover-class="navigator-hover">
|
<navigator url="/pages/my/index" open-type="navigate" hover-class="navigator-hover">
|
||||||
<button type="primary">跳转到“我的”页面</button>
|
<button type="primary">跳转到“我的”页面</button>
|
||||||
</navigator>
|
</navigator>
|
||||||
|
<demo />
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
@ -36,6 +37,7 @@ import { useCountStore, useUserStore } from '@/store'
|
|||||||
import { http } from '@/utils/http'
|
import { http } from '@/utils/http'
|
||||||
import { UserItem } from '@/typings'
|
import { UserItem } from '@/typings'
|
||||||
import { onShareAppMessage, onShareTimeline } from '@dcloudio/uni-app'
|
import { onShareAppMessage, onShareTimeline } from '@dcloudio/uni-app'
|
||||||
|
import Demo from './components/demo.vue'
|
||||||
|
|
||||||
const countStore = useCountStore()
|
const countStore = useCountStore()
|
||||||
const title = ref('Hello')
|
const title = ref('Hello')
|
||||||
|
3
uni-pages.d.ts
vendored
3
uni-pages.d.ts
vendored
@ -7,7 +7,8 @@ interface NavigateToOptions {
|
|||||||
url: "pages/index/index" |
|
url: "pages/index/index" |
|
||||||
"pages/demo/index" |
|
"pages/demo/index" |
|
||||||
"pages/my/index" |
|
"pages/my/index" |
|
||||||
"pages/throughout/index";
|
"pages/throughout/index" |
|
||||||
|
"pages/index/components/demo";
|
||||||
}
|
}
|
||||||
interface RedirectToOptions extends NavigateToOptions {}
|
interface RedirectToOptions extends NavigateToOptions {}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user