Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tab里面使用富文本编辑器问题 #1112

Closed
BlythDD opened this issue Sep 17, 2018 · 5 comments
Closed

tab里面使用富文本编辑器问题 #1112

BlythDD opened this issue Sep 17, 2018 · 5 comments
Labels

Comments

@BlythDD
Copy link

BlythDD commented Sep 17, 2018

tab有两个组件,默认进入第一个组件,富文本在第一个组件里;默认是没有问题的,但是点击tab切换到第二个组件,然后再次切换到第一个组件,富文本就加载不出来了。至此还没找到原因;

@PanJiaChen
Copy link
Owner

#251

tab切换需要手动refs.xxx.setContent(),为了性能考虑,富文本只会监听数据变化一次。

@BlythDD
Copy link
Author

BlythDD commented Sep 17, 2018

methods: {
change(x) {
this.who=this.tabs[x].key;
if(x == 1){
this.$refs.child.setContent()
}

  },
},

是这样写在父组件的tab事件里面吗?setContent()需要添加什么东西?子组件里需要做什么

@PanJiaChen
Copy link
Owner

不好意思,看错你的问题了。

声明富文本的时候,声明一个不一样的id。

<Tinymce id="a" v-model="x" />
<Tinymce id="b" v-model="x" />

@PanJiaChen PanJiaChen added the bug label Sep 17, 2018
@PanJiaChen
Copy link
Owner

Fixed in 87b319d

@NameWjp
Copy link

NameWjp commented Sep 16, 2019

我遇到了同样的问题,tabs页切换后富文本丢失内容且无法编辑。
我的解决办法是当tab页切回来时,通过v-if强制富文本重新初始化。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants