Comments (12)
Thanks, I will fix this soon!
from typescriptable-laravel.
Sorry maybe it is a different thing, but as for now I just thinking about the Date
type like for created_at
, how can we cast it to JavaScript Date
as we get string
from the server and passed directly as component props?
Like we have this page component:
// Pages/User/UserList.vue
<script setup lang="ts">
defineProps<{
users: App.Models.User[]
}>
</script>
<template>
<ul>
<li v-for="user in users">The user <b>{{ user.name }}</b> was created on {{ user.created_at }}.</li>
</ul>
</template>
And in the server we have:
$users = User::all();
return Inertia::render('User/UserList', [
'users' => $users
]);
from typescriptable-laravel.
Solved!
from typescriptable-laravel.
Strange bug, I will try to reproduce it, thanks 👍
from typescriptable-laravel.
@ngekoding I try to reproduce your problem, but I can't, can you provide a repository like this one?
https://github.com/ewilan-riviere/laravel-typescriptable-test
from typescriptable-laravel.
Of course, here is the repository: https://github.com/ngekoding/laravel-typescriptable-test
from typescriptable-laravel.
Well, I found the issue when using DB_PREFIX, when trying to remove it, the generated types looks good:
declare namespace App.Models {
export interface User {
id?: number
name: string
email: string
role: string
email_verified_at?: Date
created_at?: Date
updated_at?: Date
password?: any
}
}
So, maybe it is the problem with the prev issue: #44
from typescriptable-laravel.
Can you try latest release: 1.11.35?
from typescriptable-laravel.
It seems to have worked now.
from typescriptable-laravel.
Thanks, I will fix this soon!
from typescriptable-laravel.
Can you try with latest release?
from typescriptable-laravel.
Sorry, will try it as soon as possible.
from typescriptable-laravel.
Related Issues (6)
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from typescriptable-laravel.