fix null error

This commit is contained in:
naskya 2023-10-02 05:38:45 +09:00
parent f8576174fd
commit d8d0ad0c00
No known key found for this signature in database
GPG Key ID: 164DFF24E2D40139

View File

@ -131,7 +131,12 @@ export default defineComponent({
this.$el.style.setProperty("--maxHeight", this.maxHeight + "px"); this.$el.style.setProperty("--maxHeight", this.maxHeight + "px");
const calcOmit = () => { const calcOmit = () => {
if (this.omitted || this.ignoreOmit || this.maxHeight == null) if (
this.omitted ||
this.ignoreOmit ||
this.maxHeight == null ||
this.$refs.content == null
)
return; return;
const height = this.$refs.content.offsetHeight; const height = this.$refs.content.offsetHeight;
this.omitted = height > this.maxHeight; this.omitted = height > this.maxHeight;