有没有纯代码编辑模式?
#5264
-
在编辑特定代码的场景中,用工具栏插入代码的方式很笨拙,而且还有个烦人的悬浮框遮挡视线。 有没有专用的设定,默认就是特定的代码类型编辑模式,不要让人用鼠标点啊选语言啊的那么麻烦。 比如我初始化编辑器,默认就是编辑 |
Beta Was this translation helpful? Give feedback.
Answered by
t1000ln
Feb 3, 2023
Replies: 1 comment 1 reply
-
自己找到方法,不太完美,将就能用: <Editor v-model="sqlHtml" :default-config="editorConfig" mode="simple"></Editor> const sqlHtml = ref('<pre><code class="language-sql"></code></pre>');
const editorConfig: Partial<IEditorConfig> = {
placeholder: '请输入SQL语句',
customAlert: function (info: string, type: AlertType): void {
throw new Error('Function not implemented.');
},
scroll: true,
readOnly: false,
autoFocus: false,
hoverbarKeys: {
'pre': {menuKeys: []}
},
}; |
Beta Was this translation helpful? Give feedback.
1 reply
Answer selected by
t1000ln
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
自己找到方法,不太完美,将就能用: