Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
basic-uniapp-v3
概览
概览
详情
活动
周期分析
版本库
存储库
文件
提交
分支
标签
贡献者
分支图
比较
统计图
问题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程表
图表
维基
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
Basic
basic-uniapp-v3
Commits
ea7ef9e9
提交
ea7ef9e9
authored
4月 23, 2023
作者:
方治民
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
feat: 添加 webveiw 示例页
上级
4c482523
显示空白字符变更
内嵌
并排
正在显示
6 个修改的文件
包含
36 行增加
和
34 行删除
+36
-34
pages.json
src/pages.json
+6
-6
index.vue
src/pages/example/index.vue
+6
-15
index.vue
src/pages/example/webview/index.vue
+13
-0
index.vue
src/pages/index/index.vue
+5
-12
pages.ts
src/utils/pages.ts
+5
-0
unocss.config.ts
unocss.config.ts
+1
-1
没有找到文件。
src/pages.json
浏览文件 @
ea7ef9e9
...
...
@@ -10,21 +10,21 @@
//
===
示例
===
{
"path"
:
"pages/example/
mapbox/
index"
,
"path"
:
"pages/example/index"
,
"style"
:
{
"navigationBarTitleText"
:
"
Mapbox 地图示例
"
"navigationBarTitleText"
:
"
示例中心
"
}
},
{
"path"
:
"pages/example/
linkedlist
/index"
,
"path"
:
"pages/example/
mapbox
/index"
,
"style"
:
{
"navigationBarTitleText"
:
"
LinkedList 大列表
示例"
"navigationBarTitleText"
:
"
Mapbox 地图
示例"
}
},
{
"path"
:
"pages/example/
linkedlist-nvue
/index"
,
"path"
:
"pages/example/
webview
/index"
,
"style"
:
{
"navigationBarTitleText"
:
"
LinkedList 大列表示例 - NVUE
"
"navigationBarTitleText"
:
"
Webview 示例
"
}
},
...
...
src/pages/example/index.vue
浏览文件 @
ea7ef9e9
<
script
setup
lang=
"ts"
>
import
*
as
Pages
from
'@/utils/pages'
// @unocss-include
const
data
=
reactive
({
items
:
[
...
...
@@ -8,23 +10,12 @@
page
:
'/pages/example/mapbox/index'
,
},
{
name
:
'LinkedList 大列表示例'
,
icon
:
'emojione-letter-z'
,
page
:
`/pages/example/linkedlist/index?multiple=true`
,
},
// #ifdef APP-PLUS
{
name
:
'LinkedList 大列表示例 - NVUE'
,
icon
:
'emojione-letter-z'
,
page
:
`/pages/example/linkedlist-nvue/index?multiple=true`
,
name
:
'Webview 示例'
,
icon
:
'logos-internetexplorer'
,
page
:
'/pages/example/webview/index'
,
},
// #endif
],
})
function
goto
(
url
:
string
)
{
uni
.
navigateTo
({
url
})
}
</
script
>
<
template
>
...
...
@@ -38,7 +29,7 @@
marginTop=
"24"
v-for=
"(item, idx) in data.items"
:key=
"idx"
@
click=
"
go
to(item.page)"
@
click=
"
Pages.
to(item.page)"
>
<view
class=
"fui-list__item fui-align__center"
>
<Icon
:class=
"[`icon-$
{item.icon}`]" size="48" />
...
...
src/pages/example/webview/index.vue
0 → 100644
浏览文件 @
ea7ef9e9
<
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
>
src/pages/index/index.vue
浏览文件 @
ea7ef9e9
...
...
@@ -2,6 +2,7 @@
import
dayjs
from
'dayjs'
import
{
checkUpgrade
}
from
'@/utils/upgrade'
import
{
useRuntime
}
from
'@/hooks/app/useRuntime'
import
*
as
Pages
from
'@/utils/pages'
const
{
app
}
=
useRuntime
()
const
year
=
ref
(
dayjs
().
year
())
...
...
@@ -23,17 +24,6 @@
Message
.
toast
(
`在手机上运行点击有惊喜~ ╰(*°▽°*)╯`
)
// #endif
}
const
animate
=
ref
()
function
handUp
()
{
if
(
animate
.
value
)
{
return
}
Message
.
toast
(
'👋🏻'
)
animate
.
value
=
'animate-swing'
setTimeout
(()
=>
(
animate
.
value
=
null
),
1500
)
}
</
script
>
<
template
>
...
...
@@ -53,7 +43,10 @@
<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>
<fui-footer
isFixed
>
<template
#
text
>
...
...
src/utils/pages.ts
0 → 100644
浏览文件 @
ea7ef9e9
export
function
to
(
url
:
string
):
void
{
uni
.
navigateTo
({
url
,
})
}
unocss.config.ts
浏览文件 @
ea7ef9e9
...
...
@@ -20,7 +20,7 @@ const transformRules = {
'='
:
'_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
({
presets
:
[
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论