v-md-editor
Version:
A markdown editor built on Vue
50 lines (46 loc) • 1.1 kB
JavaScript
import { more } from '@/utils/constants/command';
export default {
name: more,
icon: 'v-md-icon2-ios-more',
title: '更多',
menus: [
{
name: '斜体',
text: '斜体',
action(editor) {
editor.insert((selected) => {
const content = selected? selected:'斜体';
return {
text: `*${content}*`,
selected: content,
};
});
},
},
{
name: '删除线',
text: '删除线',
action(editor) {
editor.insert((selected) => {
const content = selected? selected:'删除线';
return {
text: `~~${content}~~`,
selected: content,
};
});
},
},
{
name: '插入分割线',
text: '插入分割线',
action(editor) {
editor.insert((selected) => {
const content = selected? selected + '_________________': '_________________';
return {
text: content,
};
});
},
},
],
};