Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
R
rrpgLink_FrontEnd
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Packages
Packages
List
Container Registry
Analytics
Analytics
CI / CD
Code Review
Insights
Issues
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Kesaubeeire
rrpgLink_FrontEnd
Commits
c9770aed
Commit
c9770aed
authored
Oct 23, 2023
by
KesaubeEire
Browse files
Options
Browse Files
Download
Plain Diff
edit & Merge commit '
0e55277f
'
parents
ab4fe607
0e55277f
Changes
5
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
205 additions
and
71 deletions
+205
-71
.gitignore
.gitignore
+5
-1
README.md
README.md
+12
-5
src/Content.svelte
src/Content.svelte
+161
-64
src/utils/index.js
src/utils/index.js
+24
-0
vite.config.js
vite.config.js
+3
-1
No files found.
.gitignore
View file @
c9770aed
...
...
@@ -15,8 +15,12 @@ dist-ssr
# 自定义文件夹
# -- 后端示例文件
backEndExample
#生成&推送脚本
# 自定义文件
# 生成 & 推送脚本
build-prod.bat
# 开发服务器代理配置
devServer.config.js
# Editor directories and files
.vscode/*
...
...
README.md
View file @
c9770aed
...
...
@@ -19,15 +19,21 @@ Svelte + daysiUI
## 开发
```
JavaScript
// 在 dev 模式下开发要在根目录(vite.config.js 同级目录)中
// 新建 devServer.config.js
// 改进下面的代码并复制粘贴到这个文件里
// 这个文件子在 .gitignore 中被忽略
// 可以在这里复制名称再新建文件, 不要忘记这步, 非常关键
// 单独提出来的目的是不让开发受这个代理服务器路径变更的影响
export const proxy = "http://192.168.31.103:25702";
```
```
bash
# 安装
npm
install
# 在 dev 模式下开发要在 vite.config.js 中
# 把 server -> proxy -> /api/ 中的 target
# 改为你能在本地浏览器访问到的 rrpg.duels.link 的网址
# 毕竟我是开了 NGINX 转发开发的, 比较迂回
# 这是 dev 模式开发
npm run dev:dev
...
...
@@ -58,6 +64,7 @@ npm run build:prod
-
[ ] 定时更新
-
[ ] 卡片展示
-
[x] 请求 php
-
[x] 瀑布流
-
[x] 展示基础卡片
-
[x] 图片
-
[x] 点击 Cover 预览所有图片
...
...
src/Content.svelte
View file @
c9770aed
This diff is collapsed.
Click to expand it.
src/utils/index.js
View file @
c9770aed
/** 防抖函数 -> 立即执行
* @param {function} func 操作函数
* @param {number} delay 延迟
* @returns
*/
export
function
debounceImmediate
(
func
,
delay
)
{
let
timeout
;
return
function
()
{
const
immediate
=
!
timeout
;
if
(
timeout
)
{
clearTimeout
(
timeout
);
}
timeout
=
setTimeout
(()
=>
{
// func.apply(this, arguments);
timeout
=
null
;
},
delay
);
if
(
immediate
)
{
func
.
apply
(
this
,
arguments
);
}
};
}
\ No newline at end of file
vite.config.js
View file @
c9770aed
import
{
defineConfig
}
from
'
vite
'
;
import
{
svelte
}
from
'
@sveltejs/vite-plugin-svelte
'
;
import
{
proxy
}
from
'
./devServer.config
'
import
SetEnvByCommandArg
,
{
getCommandArgv
}
from
'
vite-plugin-env-command
'
;
...
...
@@ -16,7 +17,8 @@ export default defineConfig({
server
:
{
proxy
:
{
"
/api/
"
:
{
target
:
"
http://192.168.31.103:25702
"
,
// NOTE: 在 ./devServer.config.js 文件把 proxy 后的 ip 改为你的浏览器内能访问到 rrpg.duels.link 的链接
target
:
proxy
,
changeOrigin
:
true
,
rewrite
:
(
path
)
=>
path
.
replace
(
/^
\/
api/
,
""
),
},
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment