number
Usage
User.js
import { Model } from 'pinia-orm'
class User extends Model {
static entity = 'users'
static fields () {
return {
id: this.number(0)
extraId: this.number(() => 0)
}
}
}
With Decorator
User.ts
import { Model } from 'pinia-orm'
import { Num } from 'pinia-orm/decorators'
class User extends Model {
static entity = 'users'
@Num(0) declare id: number
@Num(() => 0) declare extraId: number
}
Typescript Declarations
function number(value: number | null | (() => number | null)): Number
Table of Contents