Skip to content

Commit

Permalink
fix: Update HTML and update Vue3 example
Browse files Browse the repository at this point in the history
  • Loading branch information
Marinerer committed Dec 23, 2024
1 parent 9a05409 commit 65f1adf
Show file tree
Hide file tree
Showing 3 changed files with 43 additions and 26 deletions.
43 changes: 23 additions & 20 deletions examples/html/index.html
Original file line number Diff line number Diff line change
@@ -1,24 +1,27 @@
<!doctype html>
<html lang="zh-CN">
<head>
<meta charset="UTF-8" />
<meta http-equiv="X-UA-Compatible" content="ie=edge,chrome=1" />
<meta name="renderer" content="webkit" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta name="format-detection" content="telphone=no" />
<title><title>unity-webgl demo</title></title>
<meta name="description" content="" />
<meta name="keywords" content="" />
</head>
<body>
<div>
<canvas id="canvas" style="width: 800px; height: 600px"></canvas>

<div>
<button onclick="sendMessage()">postMessage</button>
<button onclick="onFullscreen()">Fullscreen</button>
</div>
<head>
<meta charset="UTF-8" />
<meta http-equiv="X-UA-Compatible" content="ie=edge,chrome=1" />
<meta name="renderer" content="webkit" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta name="format-detection" content="telphone=no" />
<title>unity-webgl demo</title>
<meta name="description" content="" />
<meta name="keywords" content="" />
</head>

<body>
<div>
<canvas id="canvas" style="width: 800px; height: 600px"></canvas>

<div>
<button onclick="sendMessage()">postMessage</button>
<button onclick="onFullscreen()">Fullscreen</button>
</div>
</body>
<script src="main.js" type="module"></script>
</html>
</div>
</body>
<script src="main.js" type="module"></script>

</html>
20 changes: 18 additions & 2 deletions examples/vue2/vite.config.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,25 @@
import { fileURLToPath, URL } from 'node:url'

import { defineConfig } from 'vite'
import legacy from '@vitejs/plugin-legacy'
import vue from '@vitejs/plugin-vue2'
import vue2 from '@vitejs/plugin-vue2'
// import vue2Jsx from '@vitejs/plugin-vue2-jsx'

// https://vitejs.dev/config/
export default defineConfig({
plugins: [vue(), legacy()],
plugins: [
vue2(),
// vue2Jsx(),
legacy({
targets: ['ie >= 11'],
additionalLegacyPolyfills: ['regenerator-runtime/runtime'],
}),
],
resolve: {
alias: {
'@': fileURLToPath(new URL('./src', import.meta.url)),
},
},
server: {
port: 3020,
},
Expand Down
6 changes: 2 additions & 4 deletions examples/vue3/main.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
import Vue from 'vue'
import { createApp } from 'vue'
import App from './App.vue'

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

0 comments on commit 65f1adf

Please sign in to comment.