{{ item.name }} export default { data() { return { list: [ { name: '姓名', props: 'name', show: [] }, { name: '年龄', props: 'age', show: [] }, { name: '身高', props: 'height', show: [] }, { name: '是否合格', props: 'isPass', show: [ { key: 'age', symbol: '=', value: 180 }, ], value: '' } ], formData: { name: '', age: '', height: '', isPass: '' }, }; }, methods: { shouldShow(item) { if (item.show.length === 0) { return true; } return item.show.every(condition => { const formValue = this.formData[condition.key]; switch (condition.symbol) { case '=': return formValue >= condition.value; default: return false; } }); } } };