Giter VIP home page Giter VIP logo

blade-components-scoped-slots's People

Contributors

konradkalemba avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

blade-components-scoped-slots's Issues

[Question] Some questions about design

Hi,
i would like to add the support of the html syntax to your package (it seems possible with blade)
the idea would be to use it like that (because i don't think we can override for sure the <x-slot></x-slot> parser before it occurs)

<x-scoped-slot name='row' context='$item'>
</x-scoped-slot>

to create this

@scopedscope('header', '$item')
@endscopedscope

so my questions :

  1. I would like to understand why you use this syntax : ($item) for the variables, i don't see any benefit and if we want to pass multiple variables we could pass an array in the call of the parent.
  2. What kind of other variables do you need inside the scope ? Why can't we use the $component variable to access the parent component ? What is the benefit to add more things to pass thought ?

Thanks for your answers !

How to install this package?

I downloaded your package using composer and tried to use it.

<x-ui.table
     :options="$options"
>
            @scopedslot('item', ($object))
                {{ $object }}
            @endscopedslot
</x-ui.table>
// ui/table.blade.php
   @forelse($options as $object)
        <tr>
            {{ $item($object) }}
        </tr>
    @empty
     <tr>
            nothing
     </tr>
    @endforelse

Ends up in:
Array callback has to contain indices 0 and 1

I registered your class in app.php in providers. Is there any other action I should do before using it?

Accessors do not work in scoped slots

If you have in your model

public function getFooAttribute() {
       return 'foo';
}

and you use it in scoped slot like this:

@scopedslot('tableitem', ($item))
        @dump($item->foo);  {{-- works --}}
       {{ $item->foo }}  {{-- does not work --}}
@endscopedslot

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.