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 CHANGED
@@ -1,12 +1,13 @@
1
1
  <template>
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" show-word-length></Editify>
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><br/></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,
@@ -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<typeof component>;
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;