Code Monkey home page Code Monkey logo

Comments (5)

ruibaby avatar ruibaby commented on May 22, 2024 2

拖拽上传暂时没做,等有时间研究下halo的附件上传接口在搞吧。现在暂时可以用选择图片顶替下。

在 2.11 版本,编辑器的组件新增了一个 uploadImage 的 prop,用于调用 Halo 中实现的图片上传,只需要传入 File 即可。

类型:

const props = withDefaults(
  defineProps<{
    raw?: string;
    content: string;
    uploadImage?: (file: File) => Promise<Attachment>;
  }>(),
  {
    raw: "",
    content: "",
    uploadImage: undefined,
  }
);

然后在编辑器监听粘贴或者拖拽的时候调用 props.uploadImage() 即可,不需要在编辑器内调用接口。

具体文档会体现在:halo-dev/docs#291

from halo-plugin-vditor.

justice2001 avatar justice2001 commented on May 22, 2024 1

嗯嗯,今晚我先在1.3.4的版本里把这个禁用掉,然后1.4.0的时候我会去试着实现直接上传.

from halo-plugin-vditor.

justice2001 avatar justice2001 commented on May 22, 2024

拖拽上传暂时没做,等有时间研究下halo的附件上传接口在搞吧。现在暂时可以用选择图片顶替下。

from halo-plugin-vditor.

adozhao avatar adozhao commented on May 22, 2024

拖拽上传暂时没做,等有时间研究下halo的附件上传接口在搞吧。现在暂时可以用选择图片顶替下。

可以简单搞,和halo支持的ByteMD插件一样,直接把拖拽给禁用就行了~

from halo-plugin-vditor.

justice2001 avatar justice2001 commented on May 22, 2024

OKOK,等我回去看一下

from halo-plugin-vditor.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.