v‐html - daniel-qa/Vue GitHub Wiki
v-html
<el-form-item label="內容">
<div v-html="htmlContent" class="custom-input" style="width: 90%;" />
</el-form-item>
.custom-input {
width: 100%;
min-height: 200px; /* 最小高度 */
max-height: 1000px; /* 最大高度,超過時顯示滾動條 */
overflow: auto;
padding: 8px;
border: 1px solid #dcdfe6;
border-radius: 4px;
font-size: 14px;
line-height: 1.5;
color: #606266;
background-color: #f5f7fa; /* 讓它看起來像禁用的輸入框 */
white-space: pre-wrap; /* 保留換行 */
word-wrap: break-word;
}