sub-web: fix display issue when it is deployed at a sub-path
Signed-off-by: CN_SZTL <cnsztl@project-openwrt.eu.org>
This commit is contained in:
parent
66f939fadc
commit
5b98de0531
@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=sub-web
|
||||
PKG_VERSION:=1.0.0
|
||||
PKG_RELEASE:=2
|
||||
PKG_RELEASE:=3
|
||||
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_URL:=https://github.com/CareyWang/sub-web.git
|
||||
|
||||
@ -0,0 +1,57 @@
|
||||
From 4359c358bd434d1d0b182a13a743881ee21e7d27 Mon Sep 17 00:00:00 2001
|
||||
From: CN_SZTL <cnsztl@project-openwrt.eu.org>
|
||||
Date: Mon, 11 Jan 2021 11:22:43 +0000
|
||||
Subject: [PATCH] dist: support run in curdir
|
||||
|
||||
As https://cli.vuejs.org/config/#vue-config-js said:
|
||||
```
|
||||
By default, Vue CLI assumes your app will be deployed at the root of
|
||||
a domain, e.g. https://www.my-app.com/. If your app is deployed at a
|
||||
sub-path, you will need to specify that sub-path using this option.
|
||||
For example, if your app is deployed at https://www.foobar.com/my-app/,
|
||||
set publicPath to '/my-app/'.
|
||||
|
||||
The value can also be set to an empty string ('') or a relative path (./)
|
||||
so that all assets are linked using relative paths. This allows the built
|
||||
bundle to be deployed under any public path, or used in a file system based
|
||||
environment like a Cordova hybrid app.
|
||||
```
|
||||
|
||||
Reference:
|
||||
- CareyWang/sub-web#38
|
||||
- CareyWang/sub-web#43
|
||||
|
||||
Signed-off-by: CN_SZTL <cnsztl@project-openwrt.eu.org>
|
||||
---
|
||||
src/router/index.js | 2 +-
|
||||
vue.config.js | 1 +
|
||||
2 files changed, 2 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/src/router/index.js b/src/router/index.js
|
||||
index 643aa66..583fdd9 100644
|
||||
--- a/src/router/index.js
|
||||
+++ b/src/router/index.js
|
||||
@@ -5,7 +5,7 @@ Vue.use(VueRouter);
|
||||
|
||||
const routes = [
|
||||
{
|
||||
- path: "/",
|
||||
+ path: "*",
|
||||
name: "SubConverter",
|
||||
component: () => import("../views/Subconverter.vue")
|
||||
}
|
||||
diff --git a/vue.config.js b/vue.config.js
|
||||
index c4b040b..89b25db 100644
|
||||
--- a/vue.config.js
|
||||
+++ b/vue.config.js
|
||||
@@ -5,6 +5,7 @@ function resolve(dir) {
|
||||
}
|
||||
|
||||
module.exports = {
|
||||
+ publicPath: '',
|
||||
css: {
|
||||
loaderOptions: {
|
||||
less: {
|
||||
--
|
||||
2.17.1
|
||||
|
||||
Loading…
Reference in New Issue
Block a user