DDei在线设计器-多页签编辑

说明

  本示例演示了通过插件开启多页签功能,一个文件允许存在多个页签。

  如需了解详细的API教程以及参数说明,请参考DDei文档

一、开启页签

  开启多页签编辑后,设计器会出现页签列表,点击页签可以切换。

demo.vue

<script setup lang="ts">
import DDeiEditorView from "ddei-editor";
import { DDeiCoreStandLayout } from "ddei-editor";
import { DDeiCoreBottomMenuPanel } from "ddei-editor"; // [!code ++]


const options = {
  config: { 
    "grid": 0, //网格线 // [!code --]
    "background": { color: "blue", opacity: 0.1 }, //背景色 // [!code --]
    initData: {
      controls: [
        {
          model: "102010",
          text: "初始化图形",
        }
      ]
    }
  },
  //配置扩展插件
  extensions: [
    //布局的配置
    DDeiCoreStandLayout.configuration({
      //配置插件
      'top': [],
      'middle': ['ddei-core-panel-canvasview', 'ddei-core-panel-quickcolorview'],
      'bottom': [], // [!code --]
      'left': [],
      'right': []
    }),
    //底部菜单栏的配置,只保留多页签编辑功能 // [!code ++:4]
    DDeiCoreBottomMenuPanel.configuration({
      'panels': ["ddei-core-panel-bottom-sheets"]
    })
  ],
}
</script>

<template>
  <div style="width:400px;height:400px;margin:100px auto;">// [!code --]
    <DDeiEditorView :options="options" id="ddei_editor_1"></DDeiEditorView>
  </div>// [!code --]
</template>

实时效果
在这里插入图片描述

二、设置页签数量

  通过配置多页签插件,可以设置最大支持打开页签的数量。

demo.vue

<script setup lang="ts">
import DDeiEditorView from "ddei-editor";
import { DDeiCoreStandLayout } from "ddei-editor";
import { DDeiCoreBottomMenuPanel } from "ddei-editor"; // [!code ++]
import { DDeiCoreSheetsPanel } from "ddei-editor"; // [!code ++]


const options = {
  config: { 
    "grid": 0, //网格线 // [!code --]
    "background": { color: "blue", opacity: 0.1 }, //背景色 // [!code --]
    initData: {
      controls: [
        {
          model: "102010",
          text: "初始化图形",
        }
      ]
    }
  },
  //配置扩展插件
  extensions: [
    //布局的配置
    DDeiCoreStandLayout.configuration({
      //配置插件
      'top': [],
      'middle': ['ddei-core-panel-canvasview', 'ddei-core-panel-quickcolorview'],
      'bottom': [], // [!code --]
      'left': [],
      'right': []
    }),
    //底部菜单栏的配置,只保留多页签编辑功能 // [!code ++:4]
    DDeiCoreBottomMenuPanel.configuration({
      'panels': ["ddei-core-panel-bottom-sheets"]
    }),
    //多页签插件的配置 // [!code ++:4]
    DDeiCoreSheetsPanel.configuration({
      max:3
    }),
  ],
}
</script>

<template>
  <div style="width:400px;height:400px;margin:100px auto;">// [!code --]
    <DDeiEditorView :options="options" id="ddei_editor_1"></DDeiEditorView>
  </div>// [!code --]
</template>

实时效果
在这里插入图片描述

仓库信息

源码: https://gitee.com/hoslay/ddei-editor

文档: http://docs.ddei.top

在线体验: https://www.ddei.top

技术支持

QQ:3697355039     邮箱:3697355039@qq.com
  • 10
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值