Replies: 8 comments 20 replies
-
能全部去掉是最好的,我始终觉得资源都在本地,还要起一个 server ,这种行为很奇怪 |
Beta Was this translation helpful? Give feedback.
-
如果我像下面一样改动,整个网页就会读不到数据了。 diff --git a/src/views/component/character/character.js b/src/views/component/character/character.js
index 7865907..1dd177a 100644
--- a/src/views/component/character/character.js
+++ b/src/views/component/character/character.js
@@ -11,7 +11,7 @@ const background = {
computed: {
image() {
return (
- "http://localhost:9934/resources/Version2/character/" +
+ "../../../../resources/Version2/character/" +
this.character +
".png"
);
@@ -89,7 +89,7 @@ const emptyBox = {
computed: {
image() {
return (
- "http://localhost:9934/resources/Version2/artifact/other/" +
+ "../../../../resources/Version2/artifact/other/" +
this.pos +
".png"
);
diff --git a/src/views/genshin-card.html b/src/views/genshin-card.html
index 3700ffa..7f15410 100644
--- a/src/views/genshin-card.html
+++ b/src/views/genshin-card.html
@@ -32,7 +32,7 @@
<div>
<div class="background">
<img
- src="http://localhost:9934/resources/Version2/module/mys-upper-v2-2.png"
+ src="../../resources/Version2/module/mys-upper-v2-2.png"
alt="ERROR"
/> |
Beta Was this translation helpful? Give feedback.
-
算了,我突然想起来,如果没有了 server ,前端就没有调试手段了 |
Beta Was this translation helpful? Give feedback.
-
可行,只需要把 需要在 例如,我的bot根目录是
具体拼接的话,比如写一个函数
WebStorm,live-server都可以做到创建本地server, 调试不是问题 |
Beta Was this translation helpful? Give feedback.
-
其实我觉得现在这个项目的这种方式更符合一般网页开发的习惯,一般网页目录是按照这种结构写的 现在这个bot-server的架构是把图片单独分离出去(有点类似于图床的概念),所以用一个本地server使得路径当中不需要大量的 |
Beta Was this translation helpful? Give feedback.
-
呃,我也用浏览器看了下错误,不是 json 没有读到,是我写的 diff --git a/src/views/genshin-artifact.html b/src/views/genshin-artifact.html
index 1ba5026..a2d1d65 100644
--- a/src/views/genshin-artifact.html
+++ b/src/views/genshin-artifact.html
@@ -11,7 +11,7 @@
<div>
<img
class="background"
- src="http://localhost:9934/resources/module/artifact.png"
+ :src="rootdir + '/resources/module/artifact.png'"
alt="ERROR"
/>
<div class="content">
@@ -23,7 +23,7 @@
</div>
<img
class="rarity"
- src="http://localhost:9934/resources/item/rarity.png"
+ :src="rootdir + '/resources/item/rarity.png'"
alt="ERROR"
/>
<img class="image" :src="artifactImage" alt="ERROR" />
@@ -94,7 +94,7 @@
},
artifactImage() {
return (
- "http://localhost:9934/resources/Version2/artifact/" +
+ this.rootdir + "/resources/Version2/artifact/" +
this.base.artifactID +
"/" +
this.base.slot +
@@ -117,6 +117,9 @@
this.data = res.data;
this.mainStat = res.mainStat;
});
+ this.readJSON("../../data/config/views.json", (res) => {
+ this.rootdir = res.rootdir;
+ });
},
});
</script> |
Beta Was this translation helpful? Give feedback.
-
如果用的是chrome的话,有一个比较成熟的小工作流。Firefox应该也差不多 |
Beta Was this translation helpful? Give feedback.
-
还有一步之遥了,现在不明白为什么其他的变量好使,我读到的最后就是 undefined 。
|
Beta Was this translation helpful? Give feedback.
-
我想把下面的
9934
做成变量,或者全部删掉改用本地路径,不知道是否可行,之前我想这么做但是卡住了。 @mark9804Beta Was this translation helpful? Give feedback.
All reactions