提交 ea7ef9e9 作者: 方治民

feat: 添加 webveiw 示例页

上级 4c482523
...@@ -10,21 +10,21 @@ ...@@ -10,21 +10,21 @@
// === 示例 === // === 示例 ===
{ {
"path": "pages/example/mapbox/index", "path": "pages/example/index",
"style": { "style": {
"navigationBarTitleText": "Mapbox 地图示例" "navigationBarTitleText": "示例中心"
} }
}, },
{ {
"path": "pages/example/linkedlist/index", "path": "pages/example/mapbox/index",
"style": { "style": {
"navigationBarTitleText": "LinkedList 大列表示例" "navigationBarTitleText": "Mapbox 地图示例"
} }
}, },
{ {
"path": "pages/example/linkedlist-nvue/index", "path": "pages/example/webview/index",
"style": { "style": {
"navigationBarTitleText": "LinkedList 大列表示例 - NVUE" "navigationBarTitleText": "Webview 示例"
} }
}, },
......
<script setup lang="ts"> <script setup lang="ts">
import * as Pages from '@/utils/pages'
// @unocss-include // @unocss-include
const data = reactive({ const data = reactive({
items: [ items: [
...@@ -8,23 +10,12 @@ ...@@ -8,23 +10,12 @@
page: '/pages/example/mapbox/index', page: '/pages/example/mapbox/index',
}, },
{ {
name: 'LinkedList 大列表示例', name: 'Webview 示例',
icon: 'emojione-letter-z', icon: 'logos-internetexplorer',
page: `/pages/example/linkedlist/index?multiple=true`, page: '/pages/example/webview/index',
},
// #ifdef APP-PLUS
{
name: 'LinkedList 大列表示例 - NVUE',
icon: 'emojione-letter-z',
page: `/pages/example/linkedlist-nvue/index?multiple=true`,
}, },
// #endif
], ],
}) })
function goto(url: string) {
uni.navigateTo({ url })
}
</script> </script>
<template> <template>
...@@ -38,7 +29,7 @@ ...@@ -38,7 +29,7 @@
marginTop="24" marginTop="24"
v-for="(item, idx) in data.items" v-for="(item, idx) in data.items"
:key="idx" :key="idx"
@click="goto(item.page)" @click="Pages.to(item.page)"
> >
<view class="fui-list__item fui-align__center"> <view class="fui-list__item fui-align__center">
<Icon :class="[`icon-${item.icon}`]" size="48" /> <Icon :class="[`icon-${item.icon}`]" size="48" />
......
<script setup lang="ts">
const webviewStyles = reactive({
progress: {
color: '#FF3333',
},
})
</script>
<template>
<view>
<web-view :webview-styles="webviewStyles" src="https://uniapp.dcloud.io/static/web-view.html" />
</view>
</template>
...@@ -2,6 +2,7 @@ ...@@ -2,6 +2,7 @@
import dayjs from 'dayjs' import dayjs from 'dayjs'
import { checkUpgrade } from '@/utils/upgrade' import { checkUpgrade } from '@/utils/upgrade'
import { useRuntime } from '@/hooks/app/useRuntime' import { useRuntime } from '@/hooks/app/useRuntime'
import * as Pages from '@/utils/pages'
const { app } = useRuntime() const { app } = useRuntime()
const year = ref(dayjs().year()) const year = ref(dayjs().year())
...@@ -23,17 +24,6 @@ ...@@ -23,17 +24,6 @@
Message.toast(`在手机上运行点击有惊喜~ ╰(*°▽°*)╯`) Message.toast(`在手机上运行点击有惊喜~ ╰(*°▽°*)╯`)
// #endif // #endif
} }
const animate = ref()
function handUp() {
if (animate.value) {
return
}
Message.toast('👋🏻')
animate.value = 'animate-swing'
setTimeout(() => (animate.value = null), 1500)
}
</script> </script>
<template> <template>
...@@ -53,7 +43,10 @@ ...@@ -53,7 +43,10 @@
<fui-divider /> <fui-divider />
<uni-icons type="hand-up" size="30" :class="[animate]" @click="handUp" /> <fui-button type="link" size="large" @click="Pages.to('/pages/example/index')">
<Icon icon="material-symbols:arrow-right-alt" size="48" color="gray" class="mr-1" />
<text class="color-gray">Examples</text>
</fui-button>
</view> </view>
<fui-footer isFixed> <fui-footer isFixed>
<template #text> <template #text>
......
export function to(url: string): void {
uni.navigateTo({
url,
})
}
...@@ -20,7 +20,7 @@ const transformRules = { ...@@ -20,7 +20,7 @@ const transformRules = {
'=': '_eqe_', '=': '_eqe_',
} }
const ICONS = ['emojione:globe-showing-europe-africa', 'emojione:letter-z'] const ICONS = ['emojione:globe-showing-europe-africa', 'logos:internetexplorer', 'emojione:letter-z']
export default defineConfig({ export default defineConfig({
presets: [ presets: [
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论