Skip to content

Commit 93a0898

Browse files
committed
docs(examples): add vue3 example, iife example
1 parent 015d02c commit 93a0898

22 files changed

+3508
-17
lines changed

examples/example-vue2/package-lock.json

Lines changed: 6 additions & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

examples/example-vue2/src/App.vue

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
<script lang="ts">
1717
import { Component, Vue } from "vue-property-decorator";
1818
import { Draggable } from "@he-tree/vue/vue2";
19+
import "@he-tree/vue/style/default.css";
1920
import data from "./data.json";
2021
2122
@Component({
@@ -26,13 +27,4 @@ export default class App extends Vue {
2627
}
2728
</script>
2829

29-
<style>
30-
.he-tree--rtl {
31-
direction: rtl;
32-
}
33-
.he-tree .drag-placeholder {
34-
background: #ddf2f9;
35-
border: 1px dashed #00d9ff;
36-
height: 22px;
37-
}
38-
</style>
30+
<style></style>

examples/example-vue3/.gitignore

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# Logs
2+
logs
3+
*.log
4+
npm-debug.log*
5+
yarn-debug.log*
6+
yarn-error.log*
7+
pnpm-debug.log*
8+
lerna-debug.log*
9+
10+
node_modules
11+
dist
12+
dist-ssr
13+
*.local
14+
15+
# Editor directories and files
16+
.vscode/*
17+
!.vscode/extensions.json
18+
.idea
19+
.DS_Store
20+
*.suo
21+
*.ntvs*
22+
*.njsproj
23+
*.sln
24+
*.sw?

examples/example-vue3/README.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# Vue 3 + Typescript + Vite
2+
3+
## This example is ignored by pnpm. Run `npm install` to install dependencies.
4+
5+
This template should help get you started developing with Vue 3 and Typescript in Vite. The template uses Vue 3 `<script setup>` SFCs, check out the [script setup docs](https://v3.vuejs.org/api/sfc-script-setup.html#sfc-script-setup) to learn more.
6+
7+
## Recommended IDE Setup
8+
9+
- [VSCode](https://code.visualstudio.com/) + [Volar](https://marketplace.visualstudio.com/items?itemName=johnsoncodehk.volar)
10+
11+
## Type Support For `.vue` Imports in TS
12+
13+
Since TypeScript cannot handle type information for `.vue` imports, they are shimmed to be a generic Vue component type by default. In most cases this is fine if you don't really care about component prop types outside of templates. However, if you wish to get actual prop types in `.vue` imports (for example to get props validation when using manual `h(...)` calls), you can enable Volar's `.vue` type support plugin by running `Volar: Switch TS Plugin on/off` from VSCode command palette.

examples/example-vue3/index.html

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
<!DOCTYPE html>
2+
<html lang="en">
3+
<head>
4+
<meta charset="UTF-8" />
5+
<link rel="icon" href="/favicon.ico" />
6+
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
7+
<title>Vite App</title>
8+
</head>
9+
<body>
10+
<div id="app"></div>
11+
<script type="module" src="/src/main.ts"></script>
12+
</body>
13+
</html>

0 commit comments

Comments
 (0)