Closed Davont closed 3 months ago
当前功能是 ref 支持 md 格式的字符串,最后渲染成 md 文档,如果我的md 文档里面的一句话是随机的生成的变量,我又不好拼接,希望在 字符串时候识别出来这个变量,变成我想要的字符串。或者 mdpreview 增加个 props 能够识别自定义变量
给你的变量定义一种特有的格式,比如${var}存储在你的文本中,在传递给组件之前使用值替换一下就可以了吧
${var}
参考文档中的示例:https://github.com/imzbf/md-editor-v3/blob/dev-docs/src/pages/Doc/index.vue#L31
一个很棒的想法
当前功能是 ref 支持 md 格式的字符串,最后渲染成 md 文档,如果我的md 文档里面的一句话是随机的生成的变量,我又不好拼接,希望在 字符串时候识别出来这个变量,变成我想要的字符串。或者 mdpreview 增加个 props 能够识别自定义变量