0.0.14 • Published 4 years ago

shuyun-ng-editor v0.0.14

Weekly downloads
57
License
-
Repository
-
Last release
4 years ago
// npm
npm install shuyun-ng-editor --save

// yarn
yarn add shuyun-ng-editor --save
import angular from 'angular';
import shuyunEditor from 'shuyun-ng-editor';

angular.module('app', [shuyunEditor]);

基础编辑器使用

<!--具体用法: 参见 Demos-->
<shuyun-editor-keyword></shuyun-editor-keyword>

<shuyun-editor-content></shuyun-editor-content>

shuyun-editor-keyword

属性说明类型默认值
keywords关键词集合array见下面对单个keyword的说明
width宽度stringauto
isShowAll是否平铺显示所有关键词booleanfalse
onInsertKeywordAction点击关键词回调function() => {}

keyword

属性说明类型默认值
type平台类型string
name短生成内容的替换字符stringauto
text编辑器插入关键词显示扥文本stringstring
isShow是否显示booleantrue
defaultValue默认显示的预览文本stringname

shuyun-editor-content

属性说明类型默认值
ref获取当前编辑器实例object-
styles编辑器样式设置objectwidth, height, max-height, font-size
placeholder默认值string请输入内容…
content编辑器内容string
keywords关键词集合arrayshuyun-editor-keyword字段
isTrimSpace是否删除内容两边空格booleantrue
hasTagInPreview预览文本是否包含html标签booleanfalse
disabled编辑器禁止输入booleanfalse
illegalChar编辑器禁止输入的非法词array'œ', 'þ'
onFocus聚焦显示关键词function-
onBlur失焦隐藏关键词function-
onContentChangedAction编辑器内容发生变化调用此函数fucntion

onContentChanged 函数

编辑器内容发生变化调用此函数,返回值为:

{
	// 编辑器文本
	editorText: '',

	// 预览内容,按照换行符切割为数组
	previewText: [],

	// 总字数
	totalChars: 20,

	// 换行数
	newLineNumber: 2,

	// 变量数
	variableNumber: 1,

	// 变量预估字数
	variableWordsNumber: 20
}

短信编辑器使用

<!--具体用法: 参见 Demos-->
<shuyun-editor-sms-editor ref="" opts={}></shuyun-editor-sms-editor>

<shuyun-editor-sms-preview opts={}></shuyun-editor-sms-preview>

opts

属性说明类型默认值
content短信编辑器内容string
keywords变量集合Arrayshuyun-editor-keyword字段
isTrimSpace是否删除短信内容两边空格booleantrue
disabled短信编辑器禁止编辑booleanfalse
customSignature自定义短信签名string
customSignature自定义短信签名string
useUnsubscribe是否使用回T退booleanfalse
unsubscribeText退订的默认文案string回T退
gateway短信通道类型object

gateway

属性说明类型默认值
gatewayId短信通道idnumber
wordsLimit单条短信字数限制number70
multiLimit多条短信字数限制number67
signature短信通道内置签名string
gatewayType短信通道类型number
0.0.14

4 years ago

0.0.14-0

4 years ago

0.0.13-0

4 years ago

0.0.12-0

5 years ago

0.0.11-0

5 years ago

0.0.10-0

5 years ago

0.0.9-0

5 years ago

0.0.8-0

5 years ago

0.0.7-0

5 years ago

0.0.6-0

5 years ago

0.0.5-0

5 years ago

0.0.4-0

5 years ago

0.0.3-0

5 years ago

0.0.2-0

5 years ago