Skip to content
On this page

工具栏

关闭工具栏

默认开启,使用配置关闭

vue
<template>
  <dft-model-view :show-toolbar="false"></dft-model-view>
</template>

配置工具栏

vue
<template>
  <dft-model-view :toolbar-options="toolbarOptions"></dft-model-view>
</template>

<script setup>
const toolbarOptions = {
  scale: false,
  measure: false,
  section: false,
  ...
};
</script>
vue
<template>
  <dft-model-view :toolbar-options="toolbarOptions"></dft-model-view>
</template>
<script>
export default {
  data() {
    return {
      scale: false,
      measure: false,
      section: false,
      ...
    };
  },
};
</script>

工具栏参数说明

参数名参数说明参数名参数说明
scale缩放模式measure测量
section剖切visible模型显隐控制
selector筛选器operation操作模式
fullscreen全屏renderMode渲染模式
projection投影模式boxSelectMode框选模式
colorPicker颜色选择器cae云图
explode爆炸

slot

toolbar 插槽存在两个。分别是前置插槽和后置插槽。

vue
<dft-model-view :sceneConstructor="DFTCore.Scene" :scene-options="sceneOptions">
    <template #toolbar-prefix>
      <div>前置slot</div>
    </template>
    <template #toolbar-suffix>
      <div>后置slot</div>
    </template>
  </dft-model-view>
插槽名称插槽说明
toolbar-prefix前置插槽
toolbar-suffix后置插槽