Makes a "has many" relation of the property
import { Model } from 'pinia-orm'import Comment from './Comment'class Post extends Model { static entity = 'posts' static fields () { return { id: this.attr(null), title: this.string(''), comments: this.hasMany(Comment, 'postId') } }}
import { Model } from 'pinia-orm'import { Attr, HasMany, Str } from 'pinia-orm/dist/decorators'import Comment from './Comment'class Post extends Model { static entity = 'posts' @Attr(null) declare id: number | null @Str('') declare title: string @HasMany(() => Comment, 'postId') declare comments: Comment[]}
function hasMany( related: typeof Model, foreignKey: string, localKey?: string,): HasMany