vue-editify 0.0.1
Sign up to get free protection for your applications and to get access to all the features.
- package/README.md +3 -0
- package/examples/App.vue +80 -0
- package/examples/main.js +4 -0
- package/lib/editify.es.js +22457 -0
- package/lib/editify.umd.js +1 -0
- package/lib/style.css +1 -0
- package/package.json +38 -0
- package/src/Editify.vue +1880 -0
- package/src/components/base/Button.vue +440 -0
- package/src/components/base/Checkbox.vue +196 -0
- package/src/components/base/Icon.vue +31 -0
- package/src/components/base/Layer.vue +712 -0
- package/src/components/base/Tooltip.vue +82 -0
- package/src/components/base/Triangle.vue +159 -0
- package/src/components/bussiness/Colors.vue +138 -0
- package/src/components/bussiness/InsertImage.vue +316 -0
- package/src/components/bussiness/InsertLink.vue +136 -0
- package/src/components/bussiness/InsertTable.vue +113 -0
- package/src/components/bussiness/InsertVideo.vue +316 -0
- package/src/components/bussiness/Menu.vue +1460 -0
- package/src/components/bussiness/Toolbar.vue +1123 -0
- package/src/core/index.js +1278 -0
- package/src/css/base.less +30 -0
- package/src/css/hljs.less +54 -0
- package/src/hljs/index.js +60 -0
- package/src/icon/iconfont.css +211 -0
- package/src/icon/iconfont.ttf +0 -0
- package/src/icon/iconfont.woff +0 -0
- package/src/index.js +22 -0
- package/src/locale/en_US.js +84 -0
- package/src/locale/index.js +14 -0
- package/src/locale/zh_CN.js +84 -0
package/README.md
ADDED
package/examples/App.vue
ADDED
@@ -0,0 +1,80 @@
|
|
1
|
+
<template>
|
2
|
+
<div style="padding: 100px 50px 50px 50px">
|
3
|
+
<editify ref="editify" border height="600px" v-model="value" placeholder="Please Enter Text..." allow-paste-html show-word-length :menu="menuConfig" @menu-operate="operate"> </editify>
|
4
|
+
</div>
|
5
|
+
</template>
|
6
|
+
<script>
|
7
|
+
import { h } from 'vue'
|
8
|
+
export default {
|
9
|
+
name: 'App',
|
10
|
+
data() {
|
11
|
+
return {
|
12
|
+
value: '<p>333</p><div data-editify-task>这是一个任务列表</div><blockquote>这是一个引用块</blockquote><h1>这是一个一级标题</h1><h2>这是一个二级标题</h2><h3><span contenteditable="false" style="background:#f30;">这是一个</span><span contenteditable="false" style="background:#f30;">三级标题</span></h3><h4>这是一个四级标题</h4><h5>这是一个五级标题</h5><h6 contenteditable="false" style="background:#f30;">这是一个六级标题</h6><p>风萧萧兮西易水寒</p><p>风萧萧兮西易水寒</p><p>风萧萧222<font face="黑体-简">兮西易</font>水寒</p><p><video src="https://video.699pic.com/videos/84/16/65/a_Jf3yXN9UR8A616988416654452_10s.mp4"></video><a href="https://www.mvi-web.cn">跳转到mvi-web-plus官网</a><img src="https://www.mvi-web.cn/resources/images/mvi_image_3_1652322363025.jpeg" />333</p><pre data-editify-hljs="javascript">const a = new Worker()</pre><p><br></p><table><thead><tr><th>姓名</th><th>年龄</th><th>性别</th><th>祖籍</th></tr></thead><tbody><tr><td>凌凯</td><td>28</td><td>男</td><td>安徽</td></tr><tr><td>凌凯</td><td>28</td><td>男</td><td>安徽</td></tr><tr><td>凌凯</td><td>28</td><td>男</td><td>安徽</td></tr><tr><td>凌凯</td><td>28</td><td>男</td><td>安徽</td></tr><tr><td>凌凯</td><td>28</td><td>男</td><td>安徽</td></tr><tr><td>凌凯</td><td>28</td><td>男</td><td>安徽</td></tr><tr><td>凌凯</td><td>28</td><td>男</td><td>安徽</td></tr><tr><td>凌凯</td><td>28</td><td>男</td><td>安徽</td></tr><tr><td>凌凯</td><td>28</td><td>男</td><td>安徽</td></tr><tr><td>凌凯</td><td>28</td><td>男</td><td>安徽</td></tr><tr><td>凌凯</td><td>28</td><td>男</td><td>安徽</td></tr><tr><td>凌凯</td><td>28</td><td>男</td><td>安徽</td></tr><tr><td>凌凯</td><td>28</td><td>男</td><td>安徽</td></tr><tr><td>凌凯</td><td>28</td><td>男</td><td>安徽</td></tr><tr><td>凌凯</td><td>28</td><td>男</td><td>安徽</td></tr><tr><td>凌凯</td><td>28</td><td>男</td><td>安徽</td></tr><tr><td>凌凯</td><td>28</td><td>男</td><td>安徽</td></tr><tr><td>凌凯</td><td>28</td><td>男</td><td>安徽</td></tr></tbody></table><p><br></p><p><br></p><p>风萧萧兮西易水寒</p><p>风萧萧兮西易水寒</p><p>风萧萧兮西易水寒</p><p>风萧萧兮西易水寒</p><p>风萧萧兮西易水寒</p><p>风萧萧兮西易水寒</p><p>风萧萧兮西易水寒</p><p>风萧萧兮西易水寒</p><p>风萧萧兮西易水寒</p><p>风萧萧兮西易水寒</p><p>风萧萧兮西易水寒</p><p>风萧萧兮西易水寒</p><p>风萧萧兮西易水寒</p><p>风萧萧兮西易水寒</p><p>风萧萧兮西易水寒</p><p>风萧萧兮西易水寒</p><p>风萧萧兮西易水寒</p><p>风萧萧兮西易水寒</p><p>风萧萧兮西易水寒</p><p>风萧萧兮西易水寒</p><p>风萧萧兮西易水寒</p><p>风萧萧兮西易水寒</p><p>风萧萧兮西易水寒</p><p>风萧萧兮西易水寒</p><p>风萧萧兮西易水寒</p><p>风萧萧兮西易水寒</p><p>风萧萧兮西易水寒</p><p>风萧萧兮西易水寒</p><p>风萧萧兮西易水寒</p><p>风萧萧兮西易水寒</p>',
|
13
|
+
menuConfig: {
|
14
|
+
mode: 'fixed',
|
15
|
+
sequence: {
|
16
|
+
alert: 100
|
17
|
+
},
|
18
|
+
extends: {
|
19
|
+
alert: {
|
20
|
+
title: '自定义菜单按钮',
|
21
|
+
leftBorder: true,
|
22
|
+
rightBorder: false,
|
23
|
+
disabled: false,
|
24
|
+
active: false,
|
25
|
+
type: 'select',
|
26
|
+
options: [
|
27
|
+
{
|
28
|
+
label: '自定义功能1',
|
29
|
+
value: '1',
|
30
|
+
style: {
|
31
|
+
color: '#f30'
|
32
|
+
}
|
33
|
+
},
|
34
|
+
{
|
35
|
+
label: '自定义功能2',
|
36
|
+
value: '2',
|
37
|
+
style: {
|
38
|
+
fontWeight: 'bold'
|
39
|
+
}
|
40
|
+
},
|
41
|
+
{
|
42
|
+
label: '自定义功能3',
|
43
|
+
value: '3'
|
44
|
+
}
|
45
|
+
],
|
46
|
+
onOperate: function (name, val, instance) {
|
47
|
+
console.log(name, val, instance)
|
48
|
+
},
|
49
|
+
default: () => h('span', {}, '自定义菜单')
|
50
|
+
}
|
51
|
+
}
|
52
|
+
},
|
53
|
+
btn: null
|
54
|
+
}
|
55
|
+
},
|
56
|
+
mounted() {},
|
57
|
+
methods: {
|
58
|
+
change() {
|
59
|
+
this.$refs.editify.isSourceView = !this.$refs.editify.isSourceView
|
60
|
+
},
|
61
|
+
operate(name, val) {
|
62
|
+
console.log('触发operate事件', name, val)
|
63
|
+
}
|
64
|
+
}
|
65
|
+
}
|
66
|
+
</script>
|
67
|
+
<style lang="less">
|
68
|
+
html,
|
69
|
+
body {
|
70
|
+
height: 100%;
|
71
|
+
}
|
72
|
+
body {
|
73
|
+
margin: 0;
|
74
|
+
}
|
75
|
+
|
76
|
+
#app {
|
77
|
+
height: 100%;
|
78
|
+
overflow: auto;
|
79
|
+
}
|
80
|
+
</style>
|
package/examples/main.js
ADDED