Giter VIP home page Giter VIP logo

Comments (4)

patric-eberle avatar patric-eberle commented on June 8, 2024 1

Version 1.2.0 now falls back to the components name in case the defined blockSource is not available.

from vue-bem.

patric-eberle avatar patric-eberle commented on June 8, 2024

Sorry @monachilada, I did not see that you added a ticket... A blockSource setting is already available, but looks like I forgot to document it.

By fallback do you mean per component or on global scope? On global it should already wokr. If you donโ€˜t define a value in your options it will usethe โ€žnameโ€œ fallback.

from vue-bem.

monachilada avatar monachilada commented on June 8, 2024

Yes, I figured out the blockSource setting from digging through the code. But it's not quite what I meant. Let's say I'm doing something like this globally:

import vueBem from '@verstaerker/vue-bem';

Vue.use(vueBem, {
  blockSource: 'blockName',
});

If I set blockName: 'blah' in my component, I'm all good. But if it's not defined, I'd love it to fallback to name as normal.

Use case: 90% of my components will have the same block name as the component name, however one or two should be simplified.

For example I would like the block name for a component called 'base-button' to simply be 'button'.

from vue-bem.

patric-eberle avatar patric-eberle commented on June 8, 2024

@monachilada Thank you for the feedback. I think this could be a common case for some developers. I will give it some additional thought. Adding a simple name fallback would be easy.

from vue-bem.

Related Issues (7)

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.