@xiehy/plugin-question-card
TypeScript icon, indicating that this package has built-in type declarations

1.0.7 • Public • Published

@xiehy/plugin-question-card

题目卡标记插件

安装

$ yarn add @xiehy/plugin-question-card

添加到引擎

import Engine, { EngineInterface } from '@xiehy/engine';
import Hollow from '@xiehy/plugin-question-card';

new Engine(...,{ plugins:[QuestionCard] })

可选项

移除

移除样式命令,或提供方法。默认为 removeformat ,需要添加 @xiehy/plugin-removeformat 插件

removeCommand?:string | ((range:RangeInterface) => void);

绘制

如何绘制 block 节点,返回 false,不执行内置绘制,包括不复制 block 节点的 css 样式

/**
 * @param currentBlock 当前需要绘制的节点
 * @param block 需要被复制格式的节点
 * */
paintBlock?:(currentBlock:NodeInterface,block:NodeInterface) => boolean | void

命令

//使用 command 执行插件
engine.command.execute('QuestionCard');
//使用 command 执行查询当前状态,返回 boolean
engine.command.queryState('QuestionCard');

Readme

Keywords

none

Package Sidebar

Install

npm i @xiehy/plugin-question-card

Weekly Downloads

1

Version

1.0.7

License

MIT

Unpacked Size

22.9 kB

Total Files

7

Last publish

Collaborators

  • xiehy