Skip to content

Commit 3fc517d

Browse files
committed
chore: add demo(vue2.7)
1 parent 587c215 commit 3fc517d

10 files changed

Lines changed: 111 additions & 0 deletions

File tree

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,3 +24,4 @@ yarn-error.log*
2424
*.sw?
2525

2626
/pages
27+
example/**/node_modules

example/vue2.7/.gitignore

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
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+
node_modules2
12+
dist
13+
dist-ssr
14+
*.local
15+
16+
# Editor directories and files
17+
.vscode/*
18+
!.vscode/extensions.json
19+
.idea
20+
.DS_Store
21+
*.suo
22+
*.ntvs*
23+
*.njsproj
24+
*.sln
25+
*.sw?

example/vue2.7/README.md

Whitespace-only changes.

example/vue2.7/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.js"></script>
12+
</body>
13+
</html>

example/vue2.7/jsconfig.json

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
{
2+
"compilerOptions": {
3+
"target": "es5",
4+
"module": "esnext",
5+
"baseUrl": "./",
6+
"moduleResolution": "node",
7+
"paths": {
8+
"@/*": [
9+
"src/*"
10+
]
11+
},
12+
"lib": [
13+
"esnext",
14+
"dom",
15+
"dom.iterable",
16+
"scripthost"
17+
]
18+
}
19+
}

example/vue2.7/package.json

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
{
2+
"name": "vue27_ref",
3+
"private": true,
4+
"version": "0.0.1",
5+
"scripts": {
6+
"dev": "vite",
7+
"build": "vite build",
8+
"preview": "vite preview"
9+
},
10+
"dependencies": {
11+
"@vueuse/core": "^8.9.3",
12+
"v-code-diff": "^0.3.11",
13+
"vue": "^2.7.7"
14+
},
15+
"devDependencies": {
16+
"@vitejs/plugin-vue2": "^1.1.2",
17+
"vite": "^2.9.9"
18+
}
19+
}

example/vue2.7/public/favicon.ico

4.19 KB
Binary file not shown.

example/vue2.7/src/App.vue

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
<template>
2+
<div>
3+
<code-diff old-string="123" new-string="456" />
4+
</div>
5+
</template>
6+
<script setup>
7+
</script>
8+
<style></style>

example/vue2.7/src/main.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
import Vue from 'vue'
2+
import App from './App.vue'
3+
4+
import CodeDiff from 'v-code-diff'
5+
Vue.use(CodeDiff)
6+
7+
new Vue({
8+
render: (h) => h(App)
9+
}).$mount('#app')

example/vue2.7/vite.config.js

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
import { defineConfig } from 'vite'
2+
import vue from '@vitejs/plugin-vue2'
3+
import { resolve } from 'path'
4+
5+
// https://vitejs.dev/config/
6+
export default defineConfig({
7+
plugins: [
8+
vue()
9+
],
10+
build: {
11+
},
12+
resolve: {
13+
alias: {
14+
'@': resolve(__dirname, './src')
15+
}
16+
}
17+
})

0 commit comments

Comments
 (0)