Skip to content

Allow to not create wrapper element in i18n component #820

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

Merged
merged 7 commits into from
Jun 14, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Rename config option
  • Loading branch information
Demivan committed Jun 14, 2023
commit 1ce011f7c0d403d9f9b8ba4acab5555364739444
6 changes: 3 additions & 3 deletions src/types/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,11 @@ export interface FluentVueOptions {
}

/**
* Tag name for the component.
* Tag name used in the `i18n` component.
* Set to `false` to disable wrapping the translation in a tag.
* @default 'span'
*/
tag?: string | false
componentTag?: string | false
}

export interface TranslationContextOptions {
Expand All @@ -40,5 +40,5 @@ export interface ResolvedOptions extends TranslationContextOptions {
globalFormatAttrsName: string
directiveName: string
componentName: string
tag: string | false
componentTag: string | false
}
2 changes: 1 addition & 1 deletion src/util/options.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,6 @@ export function resolveOptions(options: FluentVueOptions): ResolvedOptions {
globalFormatAttrsName: options.globals?.functions?.formatAttrs ?? '$ta',
directiveName: options.globals?.directive ?? 't',
componentName: options.globals?.component ?? 'i18n',
tag: options.tag ?? 'span',
componentTag: options.componentTag ?? 'span',
}
}
2 changes: 1 addition & 1 deletion src/vue/component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ export function createComponent(options: ResolvedOptions) {
name: options.componentName,
props: {
path: { type: String, required: true },
tag: { type: [String, Boolean] as PropType<string | false>, default: options.tag },
tag: { type: [String, Boolean] as PropType<string | false>, default: options.componentTag },
args: { type: Object, default: () => ({}) },
html: { type: Boolean, default: false },
noTag: { type: Boolean, default: false },
Expand Down
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy