Skip to content

Commit 65f1adf

Browse files
committed
fix: Update HTML and update Vue3 example
1 parent 9a05409 commit 65f1adf

File tree

3 files changed

+43
-26
lines changed

3 files changed

+43
-26
lines changed

examples/html/index.html

Lines changed: 23 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,27 @@
11
<!doctype html>
22
<html lang="zh-CN">
3-
<head>
4-
<meta charset="UTF-8" />
5-
<meta http-equiv="X-UA-Compatible" content="ie=edge,chrome=1" />
6-
<meta name="renderer" content="webkit" />
7-
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
8-
<meta name="format-detection" content="telphone=no" />
9-
<title><title>unity-webgl demo</title></title>
10-
<meta name="description" content="" />
11-
<meta name="keywords" content="" />
12-
</head>
13-
<body>
14-
<div>
15-
<canvas id="canvas" style="width: 800px; height: 600px"></canvas>
163

17-
<div>
18-
<button onclick="sendMessage()">postMessage</button>
19-
<button onclick="onFullscreen()">Fullscreen</button>
20-
</div>
4+
<head>
5+
<meta charset="UTF-8" />
6+
<meta http-equiv="X-UA-Compatible" content="ie=edge,chrome=1" />
7+
<meta name="renderer" content="webkit" />
8+
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
9+
<meta name="format-detection" content="telphone=no" />
10+
<title>unity-webgl demo</title>
11+
<meta name="description" content="" />
12+
<meta name="keywords" content="" />
13+
</head>
14+
15+
<body>
16+
<div>
17+
<canvas id="canvas" style="width: 800px; height: 600px"></canvas>
18+
19+
<div>
20+
<button onclick="sendMessage()">postMessage</button>
21+
<button onclick="onFullscreen()">Fullscreen</button>
2122
</div>
22-
</body>
23-
<script src="main.js" type="module"></script>
24-
</html>
23+
</div>
24+
</body>
25+
<script src="main.js" type="module"></script>
26+
27+
</html>

examples/vue2/vite.config.js

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,25 @@
1+
import { fileURLToPath, URL } from 'node:url'
2+
13
import { defineConfig } from 'vite'
24
import legacy from '@vitejs/plugin-legacy'
3-
import vue from '@vitejs/plugin-vue2'
5+
import vue2 from '@vitejs/plugin-vue2'
6+
// import vue2Jsx from '@vitejs/plugin-vue2-jsx'
47

8+
// https://vitejs.dev/config/
59
export default defineConfig({
6-
plugins: [vue(), legacy()],
10+
plugins: [
11+
vue2(),
12+
// vue2Jsx(),
13+
legacy({
14+
targets: ['ie >= 11'],
15+
additionalLegacyPolyfills: ['regenerator-runtime/runtime'],
16+
}),
17+
],
18+
resolve: {
19+
alias: {
20+
'@': fileURLToPath(new URL('./src', import.meta.url)),
21+
},
22+
},
723
server: {
824
port: 3020,
925
},

examples/vue3/main.js

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
1-
import Vue from 'vue'
1+
import { createApp } from 'vue'
22
import App from './App.vue'
33

4-
new Vue({
5-
render: (h) => h(App),
6-
}).$mount('#app')
4+
createApp(App).mount('#app')

0 commit comments

Comments
 (0)