code-farmer-i / vue-markdown-editor Goto Github PK
View Code? Open in Web Editor NEWA markdown editor built on Vue
Home Page: https://code-farmer-i.github.io/vue-markdown-editor/
License: MIT License
A markdown editor built on Vue
Home Page: https://code-farmer-i.github.io/vue-markdown-editor/
License: MIT License
图片上传按示例代码拿不到files,怎么解决啊?
handleUploadImage(event, insertImage, files) {
// 拿到 files 之后上传到文件服务器,然后向编辑框中插入对应的内容
console.log(files)
// 此处只做示例
insertImage({
url:
'https://ss0.bdstatic.com/70cFvHSh_Q1YnxGkpoWK1HF6hhy/it/u=1269952892,3525182336&fm=26&gp=0.jpg',
desc: '七龙珠'
})
}
console.log(files)
打印的是undefined
类似于编辑模式的标题导航
我想要用 vue-markdown-editor 写一个自己用的笔记软件, 其它还好,但是发现 codemirror 的配置对象不支持 vim 的 keymap . 好像是因为 Ediver.vue 中没有引入 'codemirror/keymap/vim.js' 导致的, 能不能更新一下。还有初始化编辑器的时候,没有默认全屏的配置项,能不能也一起加上呢,谢谢 ^_^
在手机上图片渲染没有做到自适应,无法正常完成查看图片
作者弄得很好看哈哈
使用 xxx 对应预览是 文字只是被strong包裹 为定义对应的加粗样式
这导致在使用了reset.css的页面中无法正常显示加粗效果
Hi, thanks for the editor!
There was an error using codemirror editor, can you tell me how to solve it?
I am using example code from:
https://code-farmer-i.github.io/vue-markdown-editor/examples/codemirror-editor.html
Error text:
This dependency was not found:
* @kangc/v-md-editor/codemirror-editor in ./src/main.js
To install it, you can run: npm install --save @kangc/v-md-editor/codemirror-editor
现在只能点一下按钮才能打开大纲侧边栏
有没有vue3的开发计划啊?
在文档:快速上手中
import '@kangc/v-md-editor/lib/style/editor.css';
上述资源不存在
想找一个设置文字颜色的功能,没找到
其它语言包正常,安装php语言包时就报错了。是否是语言包的问题。新手,感谢回答。
vue.runtime.esm.js?2b0e:619 [Vue warn]: Error in callback for watcher "text": "TypeError: Cannot read property 'tokenizePlaceholders' of undefined"
found in
---> <VMdPreview> at src/preview.vue
<Scrollbar> at src/components/scrollbar/index.vue
<VMdContainer> at src/components/container.vue
<VMdEditor> at src/base-editor.vue
<EditArticle> at src/components/mainbody_components/cms/edit_article.vue
<Cms> at src/components/mainbody_components/cms/cms.vue
<Mainbody> at src/views/mainbody.vue
<App> at src/App.vue
<Root>
TypeError: Cannot read property 'tokenizePlaceholders' of undefined
at eval (prism-php.js?f652:127)
at Object.run (vuepress.js?02c6:1)
at Object.highlight (vuepress.js?02c6:1)
at highlight (vuepress.js?02c6:1)
at Object.eval [as highlight] (vuepress.js?02c6:1)
at a.fence (vuepress.js?02c6:1)
at eval (vuepress.js?02c6:1)
at eval (vuepress.js?02c6:1)
at Object.md.renderer.rules.fence (lineNumbers.js?1f9e:7)
at i.render (vuepress.js?02c6:1)
{
"dependencies": {
"@kangc/v-md-editor": "^1.4.2",
"core-js": "^3.6.5",
"markdown-it": "^11.0.0",
"vue": "^2.6.11",
"vue-router": "^3.2.0",
}
}
火狐:
Uncaught TypeError: d.a is undefined
<anonymous> base-editor.js:1
n base-editor.js:1
<anonymous> base-editor.js:1
<anonymous> base-editor.js:1
<anonymous> base-editor.js:1
<anonymous> base-editor.js:1
node_modules chunk-vendors.js:10
__webpack_require__ app.js:849
fn app.js:151
<anonymous> main.js:12
js app.js:1009
__webpack_require__ app.js:849
fn app.js:151
1 app.js:1022
__webpack_require__ app.js:849
checkDeferredModules app.js:46
<anonymous> app.js:925
<anonymous> app.js:928
base-editor.js:1
<anonymous> base-editor.js:1
n base-editor.js:1
<anonymous> base-editor.js:1
<anonymous> base-editor.js:1
<anonymous> base-editor.js:1
<anonymous> base-editor.js:1
js chunk-vendors.js:10
__webpack_require__ app.js:849
fn app.js:151
<anonymous> main.js:12
js app.js:1009
__webpack_require__ app.js:849
fn app.js:151
1 app.js:1022
__webpack_require__ app.js:849
checkDeferredModules app.js:46
<anonymous> app.js:925
<anonymous> app.js:928
谷歌:
Uncaught TypeError: Cannot read property 'config' of undefined
at Module.eval (base-editor.js?ee2d:1)
at n (base-editor.js?ee2d:1)
at eval (base-editor.js?ee2d:1)
at eval (base-editor.js?ee2d:1)
at eval (base-editor.js?ee2d:1)
at eval (base-editor.js?ee2d:1)
at Object../node_modules/@kangc/v-md-editor/lib/base-editor.js (chunk-vendors.js:10)
at __webpack_require__ (app.js:849)
at fn (app.js:151)
at eval (main.js:12)
vue3.0里面能用吗?
QQ群:798884474
希望能在鼠标hover到代码块能在右上角出现复制内容,然后点击就会复制当前代码块解析好的代码
编辑区编辑到最下方回车的时候不会自动滚动到页尾
找了好久的基于vue的编辑器就这个比较满意,使用方便,文档详细。
感谢作者
快捷复制代码有问题
编辑组件点击
会在当前地址拼接参数?file
预览组件点击没有反应
所有都不能复制不上
import VMdEditor from '@kangc/v-md-editor/lib/codemirror-editor'
import '@kangc/v-md-editor/lib/style/codemirror-editor.css'
import vuepressTheme from '@kangc/v-md-editor/lib/theme/vuepress.js' // 主题
VMdEditor.use(vuepressTheme)
import createCopyCodePlugin from '@kangc/v-md-editor/lib/plugins/copy-code/index'
VMdEditor.use(createCopyCodePlugin())
有没有什么方法可以一次导入所有代码高亮的语言包
目前发现svg、csv会导致报错
https://github.com/code-farmer-i/vue-markdown-editor/blob/dev/src/utils/file.js
// Modified from https://github.com/ElemeFE/element/blob/dev/packages/upload/src/upload-dragger.vue
export function filesFilter(files, config) {
const { accept } = config;
const filesKeys = Object.keys(files).filter((key) => {
const file = files[key];
const { type, name } = file; // 这边file是null,导致解构报错
const extension = name.indexOf('.') > -1 ? `.${name.split('.').pop()}` : '';
const baseType = type.replace(/\/.*$/, '');
return accept
.split(',')
.map((type) => type.trim())
.filter((type) => type)
.some((acceptedType) => {
if (/\..+$/.test(acceptedType)) {
return extension === acceptedType;
}
if (/\/\*$/.test(acceptedType)) {
return baseType === acceptedType.replace(/\/\*$/, '');
}
// eslint-disable-next-line no-useless-escape
// eslint-disable-next-line no-useless-escape
if (/^[^\/]+\/[^\/]+$/.test(acceptedType)) {
return type === acceptedType;
}
return false;
});
});
return filesKeys.map((key) => files[key]);
}
export function getFilesFromClipboardData(clipboardData) {
return Object.keys(clipboardData.items)
.filter((key) => clipboardData.items[key].kind === 'file')
.map((key) => clipboardData.items[key].getAsFile()); // 这里getAsFile()返回null,导致上面报错
}
如题,
期待的搓小手手
之后会支持 plantuml 吗
在手机端 ,图片无法正常, 点击预览图片,也出现不能正常不能 100% 充满
This is awesome. Could you provide an English version of the documentation?
在vue 3.0 vite 工具中使用 点击按钮无效,只能使用 键盘快捷键,
如何关闭右侧预览模式
在VueMarkdownEditor 中可以使用use导入插件,但在VMdPreview 中没看到有引入Katex插件的方法
😀 😀😀
您好
同步滚动建议。右侧滚动时,左侧的md没有同步滚动。看起来,左侧滚动后,右侧滚动稍微有些延迟。
就是mavon-editor的那个“双栏”按钮
简单看了下代码,学了很多东西,但是发现有个问题:
这里需要加上防抖函数,避免内容过多更新时造成的卡顿问题。
读取和编写项目内的md、网络上的md、用户本地的md
分割线会使上一行的字体加粗,如果加一行空行就不会,但是在预览组件上不解析空行 。
“-”手敲的无序列表在预览组件上不显示
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.