1.传统方式:
【静态内容换行 → 用 </br>】
【分段落 → 用 <p> 标签,而非多个 </br>】
【div等块元素换行】
2.用换行符\n+css进行换行。例如:【温度\n27.7℃】【white-space: pre-line;】
因为iviewui的 Tooltip 的content只支持文本!所以只能用换行符\n+css进行换行。
<template>
<Tooltip content="温度\n27.7℃" placement="top" :always="true" theme="light">
<img class="cloud-device-status-img" :src="imgSrc" alt="图片">
</Tooltip>
</template>
<style>
.ivu-tooltip-inner {
white-space: pre-line;//css换行
}
</style>

image.png