Skip to content

Commit

Permalink
测试
Browse files Browse the repository at this point in the history
  • Loading branch information
potato47 committed Jul 26, 2022
1 parent 256d5ed commit 65d90e2
Show file tree
Hide file tree
Showing 6 changed files with 59 additions and 11 deletions.
2 changes: 1 addition & 1 deletion index.html
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
<div id="app"></div>
<div id="app" style="width: 400px;height: 100%;display: flex;flex-direction: column;justify-content: center;"></div>
<script type="module" src="/src/main.ts"></script>
8 changes: 4 additions & 4 deletions release/preview-template/index.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,10 @@
<link rel="stylesheet" type="text/css" href="./index.css" />
</head>
<body>
<%- include(cocosToolBar, {config: config}) %>
<div id="content" class="content">
<div class="contentWrap">
<%- include('./toolbar', {config: config}) %>
<div id="content" class="content" style="flex-direction: row;">
<% include ./dist/index.html %>
<div class="contentWrap" style="flex: 1;">
<div id="GameDiv" class="wrapper">
<div id="Cocos3dGameContainer">
<canvas id="GameCanvas"></canvas>
Expand All @@ -38,7 +39,6 @@
</div>
</div>
<p class="footer">
<% include ./dist/index.html %>
</p>
</div>
<%- include(cocosTemplate, {}) %>
Expand Down
46 changes: 46 additions & 0 deletions release/preview-template/toolbar.ejs
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
<div class="toolbar disabled">
<div class="item"><button id="btn-show-devtools">CCDevtools</button></div>
<div class="item">
<select id="opts-device" value="<%=config.device%>">
<% Object.keys(devices).forEach((key) => {%>
<option value="<%=key%>"><%=devices[key].name%>(<%=devices[key].width%> X <%=devices[key].height%>)</option>
<% }) %>
</select>
</div>
<div class="item"><button id="btn-rotate" class="<%=config.rotate ? 'checked' : ''%>">Rotate</button></div>
<span style="font-size: small;" class="item">Debug Mode:</span>
<div class="item">
<select id="opts-debug-mode" value="<%=config.debugMode%>">
<option value="NONE">None</option>
<option value="VERBOSE">Verbose</option>
<option value="INFO">Info</option>
<option value="WARN">Warn</option>
<option value="ERROR">Error</option>
<option value="INFO_FOR_WEB_PAGE">Info For Web Page</option>
<option value="WARN_FOR_WEB_PAGE">Warn For Web Page</option>
<option value="ERROR_FOR_WEB_PAGE">Error For Web Page</option>
</select>
</div>
<div class="item"><button id="btn-show-fps" class="<%=config.showFps ? 'checked' : ''%>">Show FPS</button></div>
<div class="item">
<span style="font-size: small;" class="item">FPS:</span><input id="input-set-fps" type="number" value="<%=config.fps%>" />
</div>
<div style="margin-right: 0;" class="item"><button id="btn-pause">Pause</button><button id="btn-step">Step</button></div>
<div class="item"><button id="btn-step" style="display: none;">Step</button></div>
<div id="step-length">
<span>Step Length: </span>
<input type="text" value="1">
<span>ms</span>
</div>
</div>
<script>
const devtoolsBtn = document.getElementById('btn-show-devtools');
devtoolsBtn.addEventListener('click', () => {
cc.showDevtools = !cc.showDevtools;
if (cc.showDevtools) {
devtoolsBtn.classList.add('checked');
} else {
devtoolsBtn.classList.remove('checked');
}
}, false);
</script>
5 changes: 3 additions & 2 deletions src/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,14 @@ let showTree = ref(false);
</script>

<template>
<div>
<!-- <div>
<vue-final-modal v-model="showTree" classes="modal-container" content-class="modal-content" :hide-overlay="true"
:click-to-close="false" :prevent-click="true" :drag="true" :fit-parent="true" drag-selector=".modal-drag">
<TreePanel :show="showTree"></TreePanel>
</vue-final-modal>
<el-button size="small" @click="showTree = !showTree">节点树</el-button>
</div>
</div> -->
<TreePanel :show="true" style="border: 2px solid blue;"></TreePanel>
</template>

<style scoped>
Expand Down
6 changes: 3 additions & 3 deletions src/components/TreePanel.vue
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
<template>
<div
<!-- <div
style="width: 100%;height: 30px;background-color: #26282f;display: flex;align-items: center;justify-content: center;color: white;"
class="modal-drag">
节点树
</div>
</div> -->
<el-tree-v2 ref="treeView" :props="defaultProps" empty-text="正在加载场景" :highlight-current="true"
:expand-on-click-node="false" :default-expanded-keys="expandedKeys" @current-change="handleCurrentNodeChange"
@node-expand="handleNodeExpand" @node-collapse="handleNodeCollapse" :height="treeViewHeight">
<template #default="{ node }">
<span :class="{ 'node-hide': !node.data.active }">{{ node.label }}</span>
</template>
</el-tree-v2>
<div style="width: 100%;border-top: 2px solid #1d1e21;overflow: auto;flex: 1;">
<div style="width: 100%;border-top: 2px solid #1d1e21;overflow: auto;" :style="{ height: treeViewHeight }">
<template v-if="updateKey !== 0 && Utils.checkNodeValid(currentNode)">
<el-scrollbar>
<CCNode :cc-node="currentNode" :update-key="updateKey"></CCNode>
Expand Down
3 changes: 2 additions & 1 deletion vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@ export default defineConfig({
],
base: '/dist/',
build: {
outDir: './release/preview-template/dist',
outDir: '/Users/next/projects/cocos/test360/preview-template/dist',
// outDir: './release/preview-template/dist',
emptyOutDir: true
}
})

0 comments on commit 65d90e2

Please sign in to comment.