ly525 / luban-h5

[WIP]en: web design tool || mobile page builder/editor || mini webflow for mobile page. zh: 类似易企秀的H5制作、建站工具、可视化搭建系统.
https://ly525.gitee.io/luban-h5
GNU General Public License v3.0
6.1k stars 1.28k forks source link

[Bug Report] 预览时标题和描述无法修改 #290

Open bozch opened 3 years ago

bozch commented 3 years ago

问题描述 预览时标题和描述无法修改;现象是键盘输入的内容无法录入到输入框中。

环境描述/版本信息

如何复现 复现步骤

  1. 编辑作品时,单击“预览”按钮
  2. 在弹出预览框右上侧,光标定位到标题或者描述中
  3. 敲击键盘后标题和描述都没有改变,按删除delete backspace也没有效果。
  4. 本人有点前端经验,但是不才,没有定位到问题(感觉像是绑定数据的问题)

预期结果 当然是想能够编辑喽!

其它补充内容 任何和这个问题有关的额外内容

bozch commented 3 years ago

试着修改了下 front-end/src/components/core/editor/modals/preview.vue:

  1. 在data内部添加了两个内部属性workTitle 和 workDesc,用来做绑定
    import { mapActions, mapState } from 'vuex'
    ...
    ...mapState('editor', {
    editingWork: state => state.work
    }),
    ...
  2. render函数中绑定当前的作品标题和描述,如下所示:
    <div class="info">
    <h4 class="label">设置作品信息</h4>
    <a-input
    class="input"
    value={this.editingWork.title}
    onChange={e => this.updateWork({ title: e.target.value })}
    // onBlur={this.saveTitle}
    placeholder="请输入标题"
    ></a-input>
    <a-input
    class="input"
    value={this.editingWork.description}
    onChange={e => this.updateWork({ description: e.target.value })}
    // v-model="description"
    // onBlur={this.saveDescription}
    placeholder="请输入描述"
    type="textarea"
    ></a-input>
    </div>

不知道这样是否完善,还请多多指教。

ly525 commented 3 years ago

我看下 @bozch