Skip to content

怎么不自动注册,在vue中自定义使用呢? #1

Closed

Description

@febelery

源码中有从github获取wasm,可以配置自定义地址吗?

Activity

  1. chaxus commented on Jul 28, 2025

    @chaxus
    Member

    配置什么自定义地址,指的是预览服务的地址吗?这个是可以的。如果是想不注册成 web-components 使用的话,可以使用源码里面的方法,自定义挂载元素进行预览。

  2. chaxus commented on Oct 19, 2026

    @chaxus
    Member

    Implemented in 0.2.0 via PR #9.

    For explicit registration, import the passive entry rather than the default entry:

    import { registerPreview } from '@ranui/preview/manual';
    await registerPreview('app-file-preview');

    Configure Vue's compilerOptions.isCustomElement for that tag and register on the client. Importing /manual alone registers no elements and is SSR-safe. The default entry still automatically registers r-preview for existing applications.

    For the custom WASM/renderer address mentioned in the issue body, set baseUrl to your complete document editor page, including its own WASM, editor scripts, fonts and other static assets. It is not a URL to an individual WASM binary.

    Examples and deployment boundaries: README, Chinese README.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions