如果使用iview中的tooltip組件,並且tooltip組件加上了定位,那么想要讓它自動換行,就得這么寫,例子如下:
<FormItem label="密碼" prop="password">
<Tooltip
max-width="200"
style="
position:absolute;top:0;left:-80px;
min-width:200px;"
theme="light"
placement="top"
content="密碼由數字和字母組成,必須含有數字和字母,長度6-16位之間"
>
<Icon :size="18" type="ios-help-circle-outline" />
</Tooltip>
<Input
placeholder="請輸入"
type="password"
password
v-model="formData.password"
:maxlength="32"
/>
</FormItem>
---------------------------------------------------------------------------------------------------------------------------------------------------------------
標紅的代碼就是在tooltip組件被加上定位屬性后,還能繼續實現內容過長自動換行的關鍵。