Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Embed in Vue

Install

npm install @rudra/vue @rudra/editor @rudra/wasm

Usage

<template>
  <S1EditorVue
    ref="editor"
    theme="default"
    toolbar="standard"
    @ready="onReady"
    @change="onChange"
    style="height: 100vh"
  />
</template>

<script setup>
import { ref } from 'vue';
import { S1EditorVue } from '@rudra/vue';

const editor = ref(null);
const onReady = () => console.log('Ready');
const onChange = (e) => console.log('Changed:', e.type);

const openFile = async (file) => {
  const buffer = await file.arrayBuffer();
  editor.value?.open(buffer);
};
</script>