Giter Club home page Giter Club logo

Comments (12)

ewilan-riviere avatar ewilan-riviere commented on June 9, 2024 1

Thanks, I will fix this soon!

from typescriptable-laravel.

ngekoding avatar ngekoding commented on June 9, 2024 1

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.

ngekoding avatar ngekoding commented on June 9, 2024 1

Solved!

Screen Shot 2024-01-16 at 08 13 24

from typescriptable-laravel.

ewilan-riviere avatar ewilan-riviere commented on June 9, 2024

Strange bug, I will try to reproduce it, thanks 👍

from typescriptable-laravel.

ewilan-riviere avatar ewilan-riviere commented on June 9, 2024

@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.

ngekoding avatar ngekoding commented on June 9, 2024

Of course, here is the repository: https://github.com/ngekoding/laravel-typescriptable-test

from typescriptable-laravel.

ngekoding avatar ngekoding commented on June 9, 2024

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.

ewilan-riviere avatar ewilan-riviere commented on June 9, 2024

Can you try latest release: 1.11.35?

from typescriptable-laravel.

ngekoding avatar ngekoding commented on June 9, 2024
Screen Shot 2024-01-12 at 06 02 36

It seems to have worked now.

from typescriptable-laravel.

ewilan-riviere avatar ewilan-riviere commented on June 9, 2024

Thanks, I will fix this soon!

from typescriptable-laravel.

ewilan-riviere avatar ewilan-riviere commented on June 9, 2024

Can you try with latest release?

from typescriptable-laravel.

ngekoding avatar ngekoding commented on June 9, 2024

Sorry, will try it as soon as possible.

from typescriptable-laravel.

Related Issues (6)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.