forked from opentiny/tiny-vue
fix(rich-text-editor): [rich-text-editor] fix data binding doen't work (#1779)
* fix(rich-text-editor): [rich-text-editor] fix double data binding doesn't work * feat(rich-text-editor): add type for intellisense * fix: remove renderless extra deps
This commit is contained in:
parent
db85c86827
commit
5bc79b23a7
|
@ -2,6 +2,8 @@
|
|||
<div>
|
||||
<tiny-rich-text-editor v-model="value"></tiny-rich-text-editor>
|
||||
<div class="result">
|
||||
<hr />
|
||||
<textarea v-model="value" style="width: 100%" rows="5" />
|
||||
<hr />
|
||||
<pre>{{ value }}</pre>
|
||||
</div>
|
||||
|
|
|
@ -10,6 +10,7 @@ import {
|
|||
eventClick,
|
||||
Active
|
||||
} from './index'
|
||||
import type { ISharedRenderlessParamHooks } from '@/types'
|
||||
|
||||
export const api = [
|
||||
'state',
|
||||
|
@ -26,7 +27,7 @@ export const api = [
|
|||
]
|
||||
export const renderless = (
|
||||
props,
|
||||
{ computed, onBeforeUnmount, reactive },
|
||||
{ computed, onBeforeUnmount, reactive, watch }: ISharedRenderlessParamHooks,
|
||||
{ vm, emit },
|
||||
{
|
||||
Editor,
|
||||
|
@ -293,5 +294,12 @@ export const renderless = (
|
|||
state.editor.destroy()
|
||||
})
|
||||
|
||||
watch(
|
||||
() => props.modelValue,
|
||||
(value) => {
|
||||
state.editor.commands.setContent(value)
|
||||
}
|
||||
)
|
||||
|
||||
return api
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue