Coder Social home page Coder Social logo

zhangzhonghe / angular-editor Goto Github PK

View Code? Open in Web Editor NEW
1.0 0.0 0.0 800 KB

The angular version of Markdown WYSIWYG Editor. GFM Standard + Chart & UML Extensible.

License: MIT License

JavaScript 2.50% TypeScript 10.89% HTML 0.30% CSS 86.31%
editor angular wysiwyg markdown frontend component tui-editor

angular-editor's Introduction

angular-editor-component v1.0.1

该库是用 Angular CLI 9.1.7 生成的。依赖于tui.editor

安装

运行 npm i --save angular-editor-component 安装.

使用方法

...
import { EditorModule } from 'angular-editor-component';

@NgModule({
    ...
    imports: [
        EditorModule    // 引入模块
    ]
})
export class AppModule { }

在html文件中使用

<ng-editor></ng-editor>

属性

属性 类型 说明
height string 设置编辑器整体的高度
minHeight string 设置编辑器的最小高度
previewStyle 'tab' | 'vertical' 预览的样式
language string i18n, 设置编辑器的语言,默认中文
initialValue string 编辑器的初始内容
initialEditType stirng 初始编辑的类型
placeholder string 编辑器占位符
toolbarItems string[] 一个数组,设置需要显示的工具条中按钮的数量

事件

事件名 何时触发
onload 当编辑器实例创建完成时触发,并返回编辑器实例
onchange 当内容发生变化时触发
stateChange 状态改变时触发
onfocus 编辑器聚焦时触发
onblur 编辑器失焦时触发
addImageBlobHook 添加图片时触发
previewBeforeHook 预览时触发

全面的API请访问这里。如有更复杂的需求,推荐直接使用tui-editor

angular-editor's People

Contributors

dependabot[bot] avatar zhangzhonghe avatar

Stargazers

 avatar

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.