'Difference Between @property and @type
Question is as the title.
When should I use @property/@prop and @type when documenting an object and its nested properties?
Code Sample
// JSDoc Schema
/**
* @typedef {Object} Profile - user profile
* @prop {String} Profile.id - user id
* @prop {String} Profile.name - user name
* @prop {?String} Profile.imageUrl - user profile image url
*/
export default ({
namespaced: true,
state: () => ({
/**
* @prop {Object} seller - seller data
*/
seller: {
/**
* Seller profile
* // only "@type" can make the tool tip shows correctly, and not "@prop"
* // but why?
* @type {?Profile}
*/
profile: null,
},
//...
});
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
