Skip to content

Commit

Permalink
🐛 Fix the base path
Browse files Browse the repository at this point in the history
  • Loading branch information
palmcivet committed Jan 28, 2022
1 parent 9098493 commit de4802f
Show file tree
Hide file tree
Showing 9 changed files with 27 additions and 20 deletions.
15 changes: 7 additions & 8 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,17 +32,16 @@ jobs:
- name: 🛎️ Checkout GitHub
uses: actions/checkout@master

- name: 🔨 Setup Node
uses: actions/setup-node@v2
with:
node-version: '16.x'
registry-url: 'https://registry.npmjs.org'

- name: 🔧 Install and Build
- name: 🔨 Install and Build
run: |
yarn
yarn build
- name: 🔧 Setup Node
uses: actions/setup-node@v2
with:
registry-url: 'https://registry.npmjs.org'

- name: 📚 Release
uses: softprops/action-gh-release@v1
with:
Expand All @@ -51,4 +50,4 @@ jobs:
- name: 📦 Publish to NPM
run: yarn publish --access public
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
2 changes: 1 addition & 1 deletion demo/index.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<!DOCTYPE html>
<html lang="en">
<html lang="cn">
<head>
<meta charset="UTF-8" />
<link rel="icon" href="/favicon.ico" />
Expand Down
9 changes: 7 additions & 2 deletions demo/src/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ body {
.refs {
width: 250px;
height: 70vh;
height: 80%;
background: #2c3e50;
color: #bfbfbf;
}
Expand All @@ -107,6 +107,11 @@ body {
width: 100%;
height: 100vh;
@media screen and (max-width: 1024px) {
min-width: 1024px;
min-height: 768px;
}
.navbar {
width: 220px;
padding: 0 10px;
Expand Down Expand Up @@ -161,7 +166,7 @@ body {
box-sizing: border-box;
border: 2px solid #165dff;
height: calc(100% - 10px * 2);
width: calc(100vw - 220px);
width: calc(100% - 220px);
margin: 0 10px;
.demo {
Expand Down
2 changes: 1 addition & 1 deletion demo/src/components/ListViewDemo.vue
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ export default defineComponent({
};
onMounted(async () => {
ListData.value = await (await fetch("/data/list.json")).json();
ListData.value = await (await fetch(`${import.meta.env.BASE_URL}data/list.json`)).json();
ListViewInstance.value = new ListView<string>(listviewRef.value!, {
itemHeight: 24,
Expand Down
2 changes: 1 addition & 1 deletion demo/src/components/SplitViewDemo.vue
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ export default defineComponent({
.refs {
width: 100%;
height: 70vh;
height: 70%;
background: #2c3e50;
}
Expand Down
4 changes: 2 additions & 2 deletions demo/src/components/TreeViewDemo.vue
Original file line number Diff line number Diff line change
Expand Up @@ -40,13 +40,13 @@ export default defineComponent({
};
onMounted(async () => {
TreeData.value = await (await fetch("data/tree-level-1.json")).json();
TreeData.value = await (await fetch(`${import.meta.env.BASE_URL}data/tree-level-1.json`)).json();
TreeViewInstance.value = new TreeView(
treeviewRef.value!,
{
fetchHandler: async () => {
return await (await fetch("data/tree-level-1.json")).json();
return await (await fetch(`${import.meta.env.BASE_URL}data/tree-level-1.json`)).json();
},
},
TreeData.value
Expand Down
8 changes: 4 additions & 4 deletions demo/src/env.d.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
/// <reference types="vite/client" />

declare module '*.vue' {
import { DefineComponent } from 'vue'
declare module "*.vue" {
import { DefineComponent } from "vue";
// eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/ban-types
const component: DefineComponent<{}, {}, any>
export default component
const component: DefineComponent<{}, {}, any>;
export default component;
}
3 changes: 3 additions & 0 deletions demo/vite.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@ export default defineConfig({
base: `/${homepage[homepage.length - 1]}/`,
server: {
port: 30000,
fs: {
allow: [".."],
},
},
plugins: [vue()],
});
2 changes: 1 addition & 1 deletion tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,6 @@
"outDir": "dist",
"noImplicitReturns": true
},
"include": ["src/**/*.ts"],
"include": ["src/**/*.ts", "demo/**/*.d.ts"],
"exclude": ["src/**/*.test.ts"]
}

0 comments on commit de4802f

Please sign in to comment.