This commit is contained in:
nextfu 2022-07-26 20:05:42 +08:00
parent 65d90e20b9
commit 6aeca4583e
5 changed files with 40 additions and 32 deletions

1
components.d.ts vendored
View File

@ -10,6 +10,7 @@ declare module '@vue/runtime-core' {
CCComponent: typeof import('./src/components/CCComponent.vue')['default']
CCNode: typeof import('./src/components/CCNode.vue')['default']
ElButton: typeof import('element-plus/es')['ElButton']
ElCard: typeof import('element-plus/es')['ElCard']
ElCheckbox: typeof import('element-plus/es')['ElCheckbox']
ElColorPicker: typeof import('element-plus/es')['ElColorPicker']
ElInput: typeof import('element-plus/es')['ElInput']

View File

@ -18,30 +18,32 @@
<link rel="stylesheet" type="text/css" href="./index.css" />
</head>
<body>
<%- 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>
</div>
<div id="splash">
<div class="progress-bar stripes"><span></span></div>
</div>
<div id="bulletin">
<div id="sceneIsEmpty" class="inner"><%=tip_sceneIsEmpty%></div>
</div>
<div class="error" id="error">
<div class="title">Error <i>(Please open the console to see detailed errors)</i></div>
<div class="error-main"></div>
<%- include(cocosToolBar, {config: config}) %>
<div style="display: flex;flex: auto;align-items: center;">
<%- include ./dist/index.html %>
<div id="content" class="content">
<div class="contentWrap">
<div id="GameDiv" class="wrapper">
<div id="Cocos3dGameContainer">
<canvas id="GameCanvas"></canvas>
</div>
<div id="splash">
<div class="progress-bar stripes"><span></span></div>
</div>
<div id="bulletin">
<div id="sceneIsEmpty" class="inner"><%=tip_sceneIsEmpty%></div>
</div>
<div class="error" id="error">
<div class="title">Error <i>(Please open the console to see detailed errors)</i></div>
<div class="error-main"></div>
</div>
</div>
</div>
<p class="footer">
Created with <a href="https://www.cocos.com/products" target="_blank" title="Cocos Creator">Cocos Creator</a>
</p>
</div>
<p class="footer">
</p>
</div>
<%- include(cocosTemplate, {}) %>
</body>
</html>

View File

@ -12,7 +12,11 @@ let showTree = ref(false);
</vue-final-modal>
<el-button size="small" @click="showTree = !showTree">节点树</el-button>
</div> -->
<TreePanel :show="true" style="border: 2px solid blue;"></TreePanel>
<!-- <div style="width: 100%;border: 2px solid blue;"> -->
<el-card :body-style="{ padding: 0 }" style="margin: 10px;">
<TreePanel :show="true"></TreePanel>
</el-card>
<!-- </div> -->
</template>
<style scoped>

View File

@ -4,14 +4,16 @@
class="modal-drag">
节点树
</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;" :style="{ height: treeViewHeight }">
<div style="width: 100%;" :style="{ height: treeViewHeight }">
<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>
<div style="width: 100%;border-top: 2px solid #414243;" :style="{ height: treeViewHeight }">
<template v-if="updateKey !== 0 && Utils.checkNodeValid(currentNode)">
<el-scrollbar>
<CCNode :cc-node="currentNode" :update-key="updateKey"></CCNode>
@ -58,7 +60,7 @@ const defaultProps = {
children: 'children',
};
const treeViewHeight = window.innerHeight * 0.4;
const treeViewHeight = (window.innerHeight - 120) / 2;
const treeView = ref(null);
onMounted(() => {

View File

@ -17,8 +17,7 @@ export default defineConfig({
],
base: '/dist/',
build: {
outDir: '/Users/next/projects/cocos/test360/preview-template/dist',
// outDir: './release/preview-template/dist',
outDir: './release/preview-template/dist',
emptyOutDir: true
}
})