1、有时项目中会遇到表单中某个表单项的内容过多而导致展示不完整,如图:
2、使用Tooltip组件
html:
<a-col :xxl="8" :xl="12" :sm="24" class="ex-item">
<a-tooltip>
<template slot="title">
{{ tipsTxt }}
</template>
<a-form-item label="信号质量:">
<a-input
disabled
v-decorator="['signalType']"
placeholder="无信号质量"
/>
</a-form-item>
</a-tooltip>
</a-col>
js:
data: {
tipsTxt: ""
}
methods: {
this.$nextTick(() => {
formData = this.form.getFieldsValue();
for (let i in formData) {
values[i] = data[i] || data[i] == 0 ? data[i] : undefined;
typeof values[i] == "string"
? (values[i] = values[i].replace(/(^\s*)|(\s*$)/g, ""))
: "";
}
this.form.setFieldsValue({
...values,
signalType: this.getSignal(value),
longitude,
latitude,
road,
roadSection,
remark,
});
this.tipsTxt = this.form.getFieldValue('signalType');
});
}
3、刚开始写到a-form-item标签里了,哈哈哈哈
天朗气清 好舒服的天气