Skip to content

humandetail/squad-editor

Repository files navigation

SquadEditor

📦 Install

Install with npm:

npm i squad-editor

Install with yarn:

yarn add squad-editor

SquadEditor requires vue >= v3

🦄 Usage

<template>
  <squad-editor
    ref="squadEditorRef"
    v-model:value="value"
    :min-height="state.minHeight"
    :max-height="state.maxHeight"
    :tabKey="state.tabKey"
    :uploader="state.uploader"
  />
</template>

<script setup>
import { ref, reactive } from 'vue'
import SquadEditor from 'squad-editor'
import 'squad-editor/styles/index.css'

const value = ref('')
const squadEditorRef = ref(null)

const uploader = (file) => {
  return new Promise((resolve, reject) => {
    setTimeout(() => {
      resolve({ name: 'pictureName', url: 'picture.jpg' })
    }, 3000)
  })
}

const state = rective({
  minHeight: '300px',
  maxHeight: '800px',
  tabKey: '  ',
  uploader
})
</script>

📄 License

MIT License © 2019-PRESENT Humandetail

About

A Vue3 based markdown editor component

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published