@ctoweb/plugin-codeblock-vue
@ctoweb/plugin-codeblock-vue
代码块插件
安装
$ yarn add @ctoweb/plugin-codeblock-vue
添加到引擎
import Engine, { EngineInterface } from '@ctoweb/engine';
import CodeBlock , { CodeBlockComponent } from '@ctoweb/plugin-codeblock';
new Engine(...,{ plugins:[CodeBlock] , cards:[CodeBlockComponent]})
可选项
快捷键
默认无快捷键
//快捷键,key 组合键,args,执行参数,[mode?: string, value?: string] 语言模式:可选,代码文本:可选
hotkey?:string | {key:string,args:Array<string>};//默认无
//使用配置
new Engine(...,{
config:{
"codeblock":{
//修改快捷键
hotkey:{
key:"mod+b",
args:["javascript","const test = 123;"]
}
}
}
})
命令
//可携带两个参数,语言类型,默认文本,都是可选的
engine.command.execute('codeblock', 'javascript', 'const test = 123;');
Related Packages
Version History
| Version | Released | Vue | License |
|---|---|---|---|
| 3.5.3 | ^3.2.9 | MIT | |
| 3.5.2 | ^3.2.9 | MIT | |
| 3.5.0 | ^3.2.9 | MIT | |
| 3.4.8 | ^3.2.9 | MIT | |
| 3.4.0 | ^3.2.9 | MIT | |
| 3.3.0 | ^3.2.9 | MIT | |
| 3.2.0 | ^3.2.9 | MIT | |
| 3.1.1 | ^3.2.9 | MIT | |
| 3.1.0 | ^3.2.9 | MIT | |
| 3.0.44 | ^3.2.9 | MIT | |
| 3.0.43 | ^3.2.9 | MIT | |
| 3.0.2 | ^3.2.9 | MIT | |
| 2.8.61 | ^3.2.9 | MIT | |
| 2.8.54 | ^3.2.9 | ||
| 2.8.53 | ^3.2.9 | ||
| 2.8.52 | ^3.2.9 | ||
| 2.8.50 | ^3.2.9 | ||
| 2.8.45 | ^3.2.9 | MIT | |
| 2.8.44 | ^3.2.9 | MIT | |
| 2.8.43 | ^3.2.9 | MIT | |
| 2.8.42 | ^3.2.9 | MIT |
Pre-releases (18)
| Version | Released | License |
|---|---|---|
| 3.0.11-dev | MIT | |
| 2.9.9-dev | MIT | |
| 2.9.8-dev | MIT | |
| 2.9.5-dev | MIT | |
| 2.9.4-dev | MIT | |
| 2.8.99-dev | MIT | |
| 2.8.98-dev | MIT | |
| 2.8.93-dev | MIT | |
| 2.8.91-dev | MIT | |
| 2.8.81-dev | MIT | |
| 2.8.80-dev | MIT | |
| 2.8.79-dev | MIT | |
| 2.8.78-dev | MIT | |
| 2.8.77-dev | MIT | |
| 2.8.76-dev | MIT | |
| 2.8.75-dev | MIT | |
| 2.8.74-dev | MIT | |
| 2.8.73-dev | MIT |