Giter VIP home page Giter VIP logo

Comments (8)

ju5t avatar ju5t commented on August 28, 2024 7

If you use x-bind:class it works.

Credits: alpinejs/alpine#722

from blade-icons.

driesvints avatar driesvints commented on August 28, 2024 1

@Enaah yeah that was added pretty recently so this shouldn't be an issue anymore.

from blade-icons.

driesvints avatar driesvints commented on August 28, 2024

Can you copy paste the full icon tag?

from blade-icons.

ju5t avatar ju5t commented on August 28, 2024

I would normally do this:

<x-zondicon-user-group class="mr-3 h-5 w-5 text-gray-400 group-hover:text-gray-500 group-focus:text-gray-600 transition ease-in-out duration-150" :class="{ 'text-gray-600': open }" />

This returns an error, as the output is:

<?php $component->withAttributes(['class' => \Illuminate\View\Compilers\BladeCompiler::sanitizeComponentAttribute({ 'text-gray-600': open })]); ?>

Moving it in front doesn't work, as I'm overriding the class (although it feels a little sketchy what I'm doing, I must admit)

from blade-icons.

driesvints avatar driesvints commented on August 28, 2024

This isn't exactly a Blade Icons issue but rather an incompatibility with Blade components from Laravel and Alpine.js syntax. I'm not really sure how to solve this but it's probably best that you either open an issue on the Alpine.js issue tracker or a discussion on the laravel repo (not an issue). Or try a support channel like discord, laracasts forums etc.

from blade-icons.

ju5t avatar ju5t commented on August 28, 2024

@driesvints thanks, I guess it turned out to be my lack of knowledge this time :-)

from blade-icons.

csoutham avatar csoutham commented on August 28, 2024

@ju5t What was your solution for this in the end please?

from blade-icons.

Enaah avatar Enaah commented on August 28, 2024

Another solution is ::class

Source: https://laravel.com/docs/8.x/blade#escaping-attribute-rendering

from blade-icons.

Related Issues (20)

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.