我正在try 在我的单文件Vue组件上运行JSDoc.我发现了两个听起来应该可以工作的插件(两个插件实际上似乎基于相同的代码):
https://www.npmjs.com/package/vue-doc
和
https://www.npmjs.com/package/jsdoc-vue
The plugin breaks when shorth和 is used, but that's not a big issue, I can just use longh和. However every single file component I try to run JSDoc on gets this error:
相邻的JSX元素必须包装在一个封闭的标记中
这意味着我的组件没有一个根元素,但它们都有.我像这样设置了一个测试组件,但失败了:
<template>
<div>
{{someData}}
</div>
</template>
<script>
export default {
data () {
return {
someData: "Test Data"
}
},
methods: {
/**
* Just a test function
* @function
*/
testFunction: function () {
alert("Testing")
}
}
}
</script>
<style lang="stylus">
div {
border: 1px solid;
}
</style>
有没有人有在上运行JSDoc的经验.vue文件?这似乎是可能的,但网上的信息很少.
谢谢