vue-editify 0.2.25 → 0.2.27
Sign up to get free protection for your applications and to get access to all the features.
- package/examples/App.vue +11 -4
- package/lib/core/tool.d.ts +1 -1
- package/lib/editify/editify.vue.d.ts +0 -2
- package/lib/editify.es.js +51 -109
- package/lib/editify.umd.js +2 -2
- package/lib/index.d.ts +1 -3
- package/package.json +2 -2
- package/src/core/function.ts +3 -3
- package/src/core/tool.ts +1 -1
- package/src/editify/editify.vue +7 -39
- package/src/feature/redo.ts +1 -2
- package/src/feature/undo.ts +1 -3
- package/src/index.ts +1 -1
package/examples/App.vue
CHANGED
@@ -1,12 +1,13 @@
|
|
1
1
|
<template>
|
2
|
-
<div style="height: 100
|
3
|
-
<
|
2
|
+
<div style="height: 100%; padding: 40px; box-sizing: border-box">
|
3
|
+
<button @click="insert">插入</button>
|
4
|
+
<div>{{ val }}</div>
|
5
|
+
<Editify disabled :dark="dark" ref="editifyRef" border v-model="val" :menu="menuConfig" placeholder="Please Enter Text..." :toolbar="toolbarConfig" locale="zh_CN" show-word-length allow-paste-html></Editify>
|
4
6
|
</div>
|
5
7
|
</template>
|
6
8
|
<script setup lang="ts">
|
7
9
|
import { h, ref, onErrorCaptured } from 'vue'
|
8
10
|
import { Editify } from '../src'
|
9
|
-
|
10
11
|
onErrorCaptured(err => {
|
11
12
|
console.log(err)
|
12
13
|
})
|
@@ -66,7 +67,13 @@ const toolbarConfig = ref({
|
|
66
67
|
use: true,
|
67
68
|
text: {}
|
68
69
|
})
|
69
|
-
const val = ref<string>(`<p><
|
70
|
+
const val = ref<string>(`<p>3333</p><p>3333</p><p>3333</p><p>3333</p>`)
|
71
|
+
|
72
|
+
const insert = () => {
|
73
|
+
editifyRef.value!.editor.insertText('hello')
|
74
|
+
editifyRef.value!.editor.domRender()
|
75
|
+
editifyRef.value!.editor.rangeRender()
|
76
|
+
}
|
70
77
|
</script>
|
71
78
|
<style lang="less">
|
72
79
|
html,
|
package/lib/core/tool.d.ts
CHANGED
@@ -240,7 +240,7 @@ export declare const getMenuConfig: (editTrans: (key: string) => any, editLocale
|
|
240
240
|
* @param component
|
241
241
|
* @returns
|
242
242
|
*/
|
243
|
-
export declare const withInstall: <T extends Component>(component: T) => SFCWithInstall<
|
243
|
+
export declare const withInstall: <T extends Component>(component: T) => SFCWithInstall<T>;
|
244
244
|
/**
|
245
245
|
* 是否点击了编辑器以外的元素
|
246
246
|
* @param editor
|
@@ -764,8 +764,6 @@ declare const _default: import('vue').DefineComponent<{
|
|
764
764
|
menuHeight: import('vue').ComputedRef<number | null>;
|
765
765
|
collapseToEnd: () => void;
|
766
766
|
collapseToStart: () => void;
|
767
|
-
undo: () => void;
|
768
|
-
redo: () => void;
|
769
767
|
}, unknown, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
770
768
|
change: (...args: any[]) => void;
|
771
769
|
blur: (...args: any[]) => void;
|