opentiny / tiny-vue

TinyVue is an enterprise-class UI component library of OpenTiny community, support both Vue.js 2 and Vue.js 3, as well as PC and mobile.
https://opentiny.design/tiny-vue
MIT License
1.43k stars 233 forks source link

🐛 [Bug]: RichTextEditor在加载内容,修改modal value不生效 #1714

Open troopson opened 1 week ago

troopson commented 1 week ago

Version

3.16

Vue Version

3

Link to minimal reproduction

  1. RichTextEditor 设置v-modal,绑定到一个变量
  2. 通过方法,修改v-modal的值
  3. 发现变量值已经发生了变更,但是RichTextEdit中的内容并没有发生变化

Step to reproduce

示例代码:


<template>
  <div>
    <tiny-button @click="setValue">change</tiny-button>
    <tiny-rich-text-editor v-model="value"></tiny-rich-text-editor>
    <div class="result">
      <hr />
      <pre>{{ value }}</pre>
    </div>
  </div>
</template>

<script lang="ts">
import { RichTextEditor, Button } from '@opentiny/vue'

export default {
  components: {
    TinyRichTextEditor: RichTextEditor,
    TinyButton: Button
  },
  data() {
    return {
      value: '你好 Opentiny!'
    }
  },
  methods: {
     setValue(){
         this.value="==changed=="
     }
  }
}
</script>

<style scoped>
.result {
  margin-top: 16px;
  font-size: 14px;
  line-height: 1.3;
  word-break: break-all;
}
</style>

What is expected

期望改变modal value的值,编辑器中显示的内容也会发生改变

What is actually happening

No response

What is your project name

RichTextEditor

Any additional comments (optional)

No response

Issues-translate-bot commented 1 week ago

Bot detected the issue body's language is not English, translate it automatically.


Title: 🐛 [Bug]: RichTextEditor is loading content, modifying the modal value does not take effect