mirror of
https://github.com/tusen-ai/naive-ui.git
synced 2024-12-27 05:00:48 +08:00
14 lines
381 B
JavaScript
14 lines
381 B
JavaScript
export default {
|
|
mounted () {
|
|
const textAreaNotToRender = new Set(this.$refs.doc.querySelectorAll('.not-code textarea'))
|
|
this.$refs.doc.querySelectorAll('textarea').forEach(ta => {
|
|
if (textAreaNotToRender.has(ta)) {
|
|
return
|
|
}
|
|
const rows = ta.value.split('\n').length
|
|
ta.style.width = '100%'
|
|
ta.setAttribute('rows', rows)
|
|
})
|
|
}
|
|
}
|