Coder Social home page Coder Social logo

inertia-vue-lab's People

Contributors

innetto avatar

Stargazers

 avatar

Watchers

 avatar  avatar

inertia-vue-lab's Issues

Vue: Two types in props validation

  1. [Laravel] The challange is: Its common accept just one type in prop validation, but if we build a custom input that can be a text input and number when used inside a form?

We can define like modelValue: [String, Number]

Laravel: Create table, model and persist fake datas

  1. [Laravel] The challange is: Item needs to be formally developed as a class. Following MVC concepts, make Model and Controller at first and then, use a Factory and seeds to persist fake data in database.

_Use factory to create a "shape" to persist data in db is a common challange in Laravel. When we're creating our project we need to think about the concepts of MVC pattern. Model to represent our database in high level. View to create, edit, persist and delete data. Controller to be like a "bridge" between model and view. _

Vue: Custom table reusable component

  1. [VueJs] The challange is: A table component needs to be used by any other components. So it need to receive by props the columns and data to build the body table.

Reuse components in our application is really useful to avoid code repetitions around our project. Take a look at the solution on commit

Inertia: Partial reload

  1. [INERTIA] The challange is:
  • Two props are renderized into a controller method index. But, just one prop is loaded on first visit. The other one is only loaded when required (lazy).

This challange shows how inertia can make a helpful performance optimization with partial reload. We can show only the data needed in the visit using lazy loading render props.

VueJs: Jetstream Dialog Modal reusable

  1. [VueJs] The challange is: Use the Jetstream Dialog Modal component in a custom component that can receive title, content and footer from any child component.

It makes a code without repetition of import and extra lines that we just need to write once

VueJs: Render a component inside another with scoped slots

  1. [VueJs] The challange is: As we built in issue #7, we need to improve our table to receive any html element inside our table in a new cell. For example: Our table just render the columns and data (th/td). But if the parent component needs the table render a edit button, or a delete or any html element else? If we define a button html inside the table, every table parent will render the button and that certainly is not the expected behavior if we are talking about a custom reusable table.

We can use scoped slot to implement our challange. Table define a named slot and the parent component just implement this named slot inside tag. Take a lock forward

image

The name of the slot is "actions" and needs to be used with the same name in parent component

image

As a scoped slot, the table pass a data inside the slot and then the parent can use this value inside his own template, not a global value. For more, take a look at entire solution on commit.

Vue: Saving data in local storage

  1. [Laravel] The challange is: In a table, select items to checkout in another page, and then come back to the previous page without loosing data selected. Transfering page in client side only.

_We can store data in client side in many ways, but in this case, even we can use Pinia, Vuex or other plugins to work with Inertia, this challange doent require such complex solution. So quick and clear we can use local storage to keep the data saved in url changes. See the entire solution on commit.

image

Laravel: Server side form validations

  1. [Laravel] The challange is: Validate data received from client using Laravel FormRequest

When we use forms to receive data from browser, we have to concert about just send to database validated data to avoid mysql errors.

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.