【问题标题】:how to remove the html content in vue2editor如何在 vue2editor 中删除 html 内容
【发布时间】:2022-11-10 07:54:19
【问题描述】:

我们使用 Vue Editor 创建一个 html 内容并保存数据并在保存后关闭对话框。对话框关闭后我们如何去除编辑器中的html内容

使用这个编辑器在 Vuejs 中编写一个 html 文档——

从 'vue2-editor' 导入 { VueEditor }

【问题讨论】:

    标签: javascript vue.js vuejs2 vue-component vuetify.js


    【解决方案1】:

    您只需要重置已传递给“v-model”属性的数据属性,如下所示:

    <template>
      <vue-editor v-model="content" />
    </template>
    <script>
    export default {
      data() {
        return {
          content: '<p>Sample</p>',
        };
      },
      methods: {
        save() {
          // Closing dialog code
          this.content = null; // or this.content = ''
        },
      },
    };
    </script>
    

    【讨论】:

      猜你喜欢
      • 2014-06-30
      • 2022-11-22
      • 2019-03-21
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多