mirror of
https://github.com/xfgryujk/blivechat.git
synced 2025-03-13 19:30:46 +08:00
给ChatRenderer加上demo prop, 为true时自动resize
This commit is contained in:
parent
1252402e5e
commit
a69b6b6406
@ -48,6 +48,10 @@ export default {
|
||||
props: {
|
||||
paidMessages: Array,
|
||||
messages: Array,
|
||||
demo: {
|
||||
type: Boolean,
|
||||
required: false,
|
||||
},
|
||||
css: String
|
||||
},
|
||||
data() {
|
||||
@ -66,10 +70,14 @@ export default {
|
||||
this.scrollToBottom()
|
||||
},
|
||||
created() {
|
||||
window.addEventListener('resize', this.scrollToBottom)
|
||||
if (this.demo) {
|
||||
window.addEventListener('resize', this.scrollToBottom)
|
||||
}
|
||||
},
|
||||
beforeDestroy() {
|
||||
window.removeEventListener('resize', this.scrollToBottom)
|
||||
if (this.demo) {
|
||||
window.removeEventListener('resize', this.scrollToBottom)
|
||||
}
|
||||
document.head.removeChild(this.styleElement)
|
||||
},
|
||||
updated() {
|
||||
|
@ -190,7 +190,7 @@
|
||||
<el-col :span="12">
|
||||
<div id="example-container">
|
||||
<div id="fakebody">
|
||||
<chat-renderer :paidMessages="examplePaidMessages" :messages="messages" :css="exampleCss"></chat-renderer>
|
||||
<chat-renderer :paidMessages="examplePaidMessages" :messages="messages" :css="exampleCss" demo></chat-renderer>
|
||||
</div>
|
||||
</div>
|
||||
</el-col>
|
||||
|
Loading…
Reference in New Issue
Block a user