2.1.2 • Published 7 months ago

dragon-editor v2.1.2

Weekly downloads
-
License
MIT
Repository
github
Last release
7 months ago

Github stars Github issues Github forks Github top language Hits npm version npm downloads License Nuxt

KO / EN

DragonEditor

드래곤 에디터는 그냥 블로그에 쓸 이지윅 에디터가 필요해서 만들었습니다. 커스터마이징이 가능하며 Nuxt.js만 지원합니다.

사용법

에디터

<tempalte>
  <DragonEditor v-model="contentData" :option="option" ref="editor" />
</tempalte>

<script setup lang="ts">
const editor = ref();
const contentData = ref([]);
const option = ref({}); // 선택사항
</script>

컴포넌트 명령어

  1. 이미지 삽입
editor.value.addImageBlock({
    src: string;
    width: number;
    height: number;
    webp: boolean;
});
  1. 저장
editor.value.updateBlockData();
// do save

코멘트

<tempalte>
  <DragonEditorComment v-model="commentData" ref="editor" />
</tempalte>

<script setup lang="ts">
const editor = ref();
const commentData = ref({
    classList: [],
    content: "",
});
</script>

컴포넌트 명령어

  1. 스타일 설정

스타일의 경우 컴포넌트에서 다음과 같이 명령어를 사용할 수 있습니다. 해당되는 스타일이 존재하지 않을 경우 클레스에 값을 부여합니다.

editor.value.setStyles("decorationBold");
  1. 스타일 리스트
  • alignLeft : 왼쪽 정렬
  • alignCenter : 가운데 정렬
  • alignRight : 오른쪽 정렬
  • decorationBold : 볼드
  • decorationItalic : 이텔릭
  • decorationUnderline : 밑줄
  • decorationStrikethrough : 취소선
  1. 저장
editor.value.updateBlockData();
// do save
  1. 포커스
editor.value.focus();

Viewer

<tempalte>
  <DragonEditorViewer :content="contentData"/>
</tempalte>

<script setup lang="ts">
const contentData = ref([]); // Save Data for Editor
</script>

Props

  • content : This props is must be Array in Editor data.
  • mediaURL (Option) : This props is pre URL in Media.
2.1.2

7 months ago

2.1.1

7 months ago

2.1.0

7 months ago

2.0.0

10 months ago

2.0.0-beta.2.1

10 months ago

2.0.0-beta.2.1.2

10 months ago

2.0.0-beta.2.1.1

10 months ago

2.0.0-beta.2

11 months ago

2.0.0-beta.1.1

11 months ago

2.0.0-beta.1.3

11 months ago

2.0.0-beta.1.4

11 months ago

2.0.0-beta.1

11 months ago

1.1.5

2 years ago

1.1.4

2 years ago