【发布时间】:2021-10-09 13:17:47
【问题描述】:
我正在使用 eslint-plugin-vue 进行项目,并且我有子组件和父组件。 子组件需要将值传递给父组件。
// parent
export default {
name: 'recordDetail',
props: {
'record-id': { // however this will violate vue/prop-name-casing
type: Number
}
}
}
<!-- child -->
<recordDetail
:record-id="123"> <!-- it will violate vue/attribute-hyphenation if this is recordId="123" -->
</recordDetail>
请给我一些建议,告诉我你将如何处理这个问题,以及 Vue 的最佳实践是什么。 谢谢。
【问题讨论】:
标签: javascript vue.js vuejs2 eslint eslint-plugin-vue