diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 974d8b4..42bd05c 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -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: @@ -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 }} \ No newline at end of file diff --git a/demo/index.html b/demo/index.html index ec97e9f..dece143 100644 --- a/demo/index.html +++ b/demo/index.html @@ -1,5 +1,5 @@ - + diff --git a/demo/src/App.vue b/demo/src/App.vue index cc12bac..55b9d34 100644 --- a/demo/src/App.vue +++ b/demo/src/App.vue @@ -86,7 +86,7 @@ body { .refs { width: 250px; - height: 70vh; + height: 80%; background: #2c3e50; color: #bfbfbf; } @@ -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; @@ -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 { diff --git a/demo/src/components/ListViewDemo.vue b/demo/src/components/ListViewDemo.vue index 5139632..7cdcf81 100644 --- a/demo/src/components/ListViewDemo.vue +++ b/demo/src/components/ListViewDemo.vue @@ -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(listviewRef.value!, { itemHeight: 24, diff --git a/demo/src/components/SplitViewDemo.vue b/demo/src/components/SplitViewDemo.vue index d5d676b..bf7f719 100644 --- a/demo/src/components/SplitViewDemo.vue +++ b/demo/src/components/SplitViewDemo.vue @@ -159,7 +159,7 @@ export default defineComponent({ .refs { width: 100%; - height: 70vh; + height: 70%; background: #2c3e50; } diff --git a/demo/src/components/TreeViewDemo.vue b/demo/src/components/TreeViewDemo.vue index a130dd4..8bef5c6 100644 --- a/demo/src/components/TreeViewDemo.vue +++ b/demo/src/components/TreeViewDemo.vue @@ -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 diff --git a/demo/src/env.d.ts b/demo/src/env.d.ts index d27eb5a..2da5596 100644 --- a/demo/src/env.d.ts +++ b/demo/src/env.d.ts @@ -1,8 +1,8 @@ /// -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; } diff --git a/demo/vite.config.js b/demo/vite.config.js index 487ee8e..a088766 100644 --- a/demo/vite.config.js +++ b/demo/vite.config.js @@ -8,6 +8,9 @@ export default defineConfig({ base: `/${homepage[homepage.length - 1]}/`, server: { port: 30000, + fs: { + allow: [".."], + }, }, plugins: [vue()], }); diff --git a/tsconfig.json b/tsconfig.json index 95d0712..642fc4c 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -12,6 +12,6 @@ "outDir": "dist", "noImplicitReturns": true }, - "include": ["src/**/*.ts"], + "include": ["src/**/*.ts", "demo/**/*.d.ts"], "exclude": ["src/**/*.test.ts"] }