vue-editify 0.2.21 → 0.2.22
Sign up to get free protection for your applications and to get access to all the features.
- package/examples/App.vue +2 -2
- package/examples/test.html +26 -29
- package/lib/editify.es.js +4 -4
- package/lib/editify.umd.js +1 -1
- package/lib/index.d.ts +1 -1
- package/package.json +2 -2
- package/src/index.ts +1 -1
package/examples/App.vue
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
<template>
|
2
2
|
<div style="height: 100%">
|
3
|
-
<Editify :dark="dark" ref="editifyRef" border v-model="val" :menu="menuConfig" placeholder="Please Enter Text..." :toolbar="toolbarConfig" locale="zh_CN"
|
3
|
+
<Editify :dark="dark" ref="editifyRef" border v-model="val" :menu="menuConfig" placeholder="Please Enter Text..." :toolbar="toolbarConfig" locale="zh_CN" show-word-length></Editify>
|
4
4
|
</div>
|
5
5
|
</template>
|
6
6
|
<script setup lang="ts">
|
@@ -66,7 +66,7 @@ const toolbarConfig = ref({
|
|
66
66
|
use: true,
|
67
67
|
text: {}
|
68
68
|
})
|
69
|
-
const val = ref<string>(`<p
|
69
|
+
const val = ref<string>(`<p><br/></p>`)
|
70
70
|
</script>
|
71
71
|
<style lang="less">
|
72
72
|
html,
|
package/examples/test.html
CHANGED
@@ -1,32 +1,29 @@
|
|
1
1
|
<!DOCTYPE html>
|
2
2
|
<html lang="en">
|
3
|
+
<head>
|
4
|
+
<meta charset="UTF-8" />
|
5
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
6
|
+
<title>Document</title>
|
7
|
+
<script src="../node_modules/vue/dist/vue.global.prod.js"></script>
|
8
|
+
<script src="../lib/editify.umd.js"></script>
|
9
|
+
</head>
|
3
10
|
|
4
|
-
<
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
value: '<p><br></p>'
|
24
|
-
}
|
25
|
-
}
|
26
|
-
})
|
27
|
-
console.log(editify.version)
|
28
|
-
app.use(editify)
|
29
|
-
app.mount('#app')
|
30
|
-
</script>
|
31
|
-
|
32
|
-
</html>
|
11
|
+
<body>
|
12
|
+
<div id="app">
|
13
|
+
<editify v-model="value" placeholder="请输入"></editify>
|
14
|
+
</div>
|
15
|
+
</body>
|
16
|
+
<script>
|
17
|
+
const { createApp } = Vue
|
18
|
+
const app = createApp({
|
19
|
+
data() {
|
20
|
+
return {
|
21
|
+
value: '<p><br></p>'
|
22
|
+
}
|
23
|
+
}
|
24
|
+
})
|
25
|
+
console.log(editify.version)
|
26
|
+
app.use(editify)
|
27
|
+
app.mount('#app')
|
28
|
+
</script>
|
29
|
+
</html>
|
package/lib/editify.es.js
CHANGED
@@ -1623,7 +1623,7 @@ const _AlexElement = class _AlexElement2 {
|
|
1623
1623
|
this.parsedom = parsedom;
|
1624
1624
|
this.marks = marks;
|
1625
1625
|
this.styles = styles2;
|
1626
|
-
this.textContent = textContent;
|
1626
|
+
this.textContent = textContent ? textContent.replace(/\r\n/g, "\n") : textContent;
|
1627
1627
|
}
|
1628
1628
|
/**
|
1629
1629
|
* 是否根级块元素
|
@@ -3906,7 +3906,7 @@ class AlexEditor {
|
|
3906
3906
|
}
|
3907
3907
|
if (this.range.anchor.element.isText()) {
|
3908
3908
|
let val = this.range.anchor.element.textContent;
|
3909
|
-
this.range.anchor.element.textContent = val.substring(0, this.range.anchor.offset) + data2 + val.substring(this.range.anchor.offset);
|
3909
|
+
this.range.anchor.element.textContent = val.substring(0, this.range.anchor.offset) + data2.replace(/\r\n/g, "\n") + val.substring(this.range.anchor.offset);
|
3910
3910
|
this.range.anchor.offset = this.range.anchor.offset + data2.length;
|
3911
3911
|
this.range.focus.offset = this.range.anchor.offset;
|
3912
3912
|
} else {
|
@@ -5008,7 +5008,7 @@ class AlexEditor {
|
|
5008
5008
|
event$1.off(this.$el, "beforeinput.alex_editor compositionstart.alex_editor compositionupdate.alex_editor compositionend.alex_editor keydown.alex_editor cut.alex_editor paste.alex_editor copy.alex_editor dragstart.alex_editor drop.alex_editor focus.alex_editor blur.alex_editor");
|
5009
5009
|
}
|
5010
5010
|
}
|
5011
|
-
const version$2 = "1.4.
|
5011
|
+
const version$2 = "1.4.35";
|
5012
5012
|
console.log(`%c alex-editor %c v${version$2} `, "padding: 2px 1px; border-radius: 3px 0 0 3px; color: #fff; background: #606060; font-weight: bold;", "padding: 2px 1px; border-radius: 0 3px 3px 0; color: #fff; background: #42c02e; font-weight: bold;");
|
5013
5013
|
const number = {
|
5014
5014
|
/**
|
@@ -44683,7 +44683,7 @@ const Editify = withInstall(editify);
|
|
44683
44683
|
const install = (app) => {
|
44684
44684
|
app.component(Editify.name, Editify);
|
44685
44685
|
};
|
44686
|
-
const version = "0.2.
|
44686
|
+
const version = "0.2.22";
|
44687
44687
|
console.log(`%c vue-editify %c v${version} `, "padding: 2px 1px; border-radius: 3px 0 0 3px; color: #fff; background: #606060; font-weight: bold;", "padding: 2px 1px; border-radius: 0 3px 3px 0; color: #fff; background: #42c02e; font-weight: bold;");
|
44688
44688
|
export {
|
44689
44689
|
AlexElement,
|