Skip to content

富文本组件在tab页面切换的时候失效 #1462

Closed
@rill

Description

@rill
版本号:

2.2.1

问题描述:

模板管理里点击新增一个系统类型的模板,富文本内容随便填一点,然后保存。这时候点编辑是正常的。
切换tab菜单到消息管理,然后再切换到模板管理。这时候再点新增富文本的内容无法输入;编辑的时候富文本的内容无法显示也无法输入。
此问题在官方的网站也能复现。
http://boot.jeecg.com/modules/message/sysMessageTemplateList

截图&代码:

image
image
代码直接是jeecg-boot原有的代码,未做任何改动。

友情提示: 未按格式要求发帖,会直接删掉。

Activity

kx-hdh

kx-hdh commented on Jul 16, 2020

@kx-hdh

有同样的问题

zhangdaiscott

zhangdaiscott commented on Jul 18, 2020

@zhangdaiscott
Member

收录,我们确认下

tygithub1

tygithub1 commented on Jul 24, 2020

@tygithub1

1.在TabLayout.vue文件中添加method

     excuteCallback(callback){
        callback()
      },

2.在JEditor.vue文件中initATabsChangeAutoReload方法添加else逻辑

    initATabsChangeAutoReload() {
        // 获取父级
        let tabs = getVmParentByName(this, 'ATabs')
        let tabPane = getVmParentByName(this, 'ATabPane')
        if (tabs && tabPane) {
          // 用户自定义的 key
          let currentKey = tabPane.$vnode.key
          // 添加事件监听
          tabs.$on('change', (key) => {
            // 切换到自己时执行reload
            if (currentKey === key) {
              this.reload()
            }
          })
        }else{
          let tabLayout = getVmParentByName(this, 'TabLayout')
          tabLayout.excuteCallback(()=>{
            this.reload()
          })
        }
      },
rill

rill commented on Jul 25, 2020

@rill
Author

@tygithub1 大写的赞。
@zhangdaiscott 看是否可以合并到下个版本里。

cooper1x

cooper1x commented on Aug 8, 2024

@cooper1x

1.在TabLayout.vue文件中添加method

     excuteCallback(callback){
        callback()
      },

2.在JEditor.vue文件中initATabsChangeAutoReload方法添加else逻辑

    initATabsChangeAutoReload() {
        // 获取父级
        let tabs = getVmParentByName(this, 'ATabs')
        let tabPane = getVmParentByName(this, 'ATabPane')
        if (tabs && tabPane) {
          // 用户自定义的 key
          let currentKey = tabPane.$vnode.key
          // 添加事件监听
          tabs.$on('change', (key) => {
            // 切换到自己时执行reload
            if (currentKey === key) {
              this.reload()
            }
          })
        }else{
          let tabLayout = getVmParentByName(this, 'TabLayout')
          tabLayout.excuteCallback(()=>{
            this.reload()
          })
        }
      },

我原本的代码就有这个,发现还是有这个bug,我的是keepalive的组件

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      No branches or pull requests

        Participants

        @rill@zhangdaiscott@cooper1x@kx-hdh@tygithub1

        Issue actions

          富文本组件在tab页面切换的时候失效 · Issue #1462 · jeecgboot/JeecgBoot