Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add mixin options #65

Closed
wants to merge 1 commit into from

Conversation

iammaxence
Copy link

Generate a component with options to mixin.

Working with Tikui, i find out that i often re-create the same code to add options to mixin.
That's why i propose to add the possibility to generate a component with options to mixin.

The related issue #62

let content = `mixin ${dashPrefix(prefix)}${component}\n .${dashPrefix(prefix)}${component} ${component}\n`;
if(mixinOptions) {
content = `mixin ${dashPrefix(prefix)}${component}(options)\n` +
'\t-const opt = options || {};\n' +
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe you need to put spaces instead of tabulation

const createMixin = (componentDirectory: string, component: string, prefix?: string, mixinOptions?: boolean): void => {
let content = `mixin ${dashPrefix(prefix)}${component}\n .${dashPrefix(prefix)}${component} ${component}\n`;
if(mixinOptions) {
content = `mixin ${dashPrefix(prefix)}${component}(options)\n` +
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe you can extract to a function that returns content in order to prevent content mutation here

@Gnuk
Copy link
Member

Gnuk commented Aug 31, 2024

I'll close this PR because of inactivity. Please create another PR if you really need this feature.

@Gnuk Gnuk closed this Aug 31, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants