npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2025 – Pkg Stats / Ryan Hefner

@fluendo/vue

v1.3.0

Published

Fluendo utils vue + typescript

Downloads

60

Readme

alt text

npm version npm version npm version

Introduccion

To use this library it is recommended to work with a project using Vue Cli 3 with TypeScript:

vue cli install

When the project has been installed we will install:

npm install @fluendo/vue -D

And set VueFluendo in your project:

import Vue from 'vue';
import VueFluendo from '@fluendo/vue';

Vue.use(VueFluendo);

We will create the file vue.config.js in the root and add the configuration to compile the html files.

vue config

Usage

With this library we have tried to offer certain utilities to projects that work with Vue + TypeScript.

Components

@FluendoComponent() It is an extension @Component of vue-property-decorator, but in this case will allow us to create an html tag for our component so we can call our component from any html without having to put the name of the class. In this decorator we will have several configuration options:

| attribute | descripcion | |---|---| |selector| This is the html tag that we can use later to call the component| |withRender| Here we will put the relative path of our files *.html,*.scss from the folder src | |declarations| The classes of the directives, pipes, components that we want to use in our component | |Injector| The classes that we want to inject into our component |

Create hello.component.ts:

import { FluendoComponent } from '@fluendo/vue';

@FluendoComponent({
    selector: 'flu-hello',
    withRender: '@/hello.component',
})

export class HelloComponent {}

And we can use this component in this way:

import { FluendoComponent } from '@fluendo/vue';

import { HelloComponent } from './hello.component';

@FluendoComponent({
    withRender: '@/home.component',
    declarations: [
        HelloComponent,
    ],
})

export class HomeComponent {}

And in the html:

<div>
    <h1>Home</h1>
    <flu-hello />
</div>
Injectors

@FluendoInjector() is the decorator that will allow us to use our provider in any of our components where it is initialized.

In the file hello.service.ts we will create our injector:

import { FluendoInjector } from '@fluend/vue';

@FluendoInjector({
  name: 'service'
})

export class HelloService {
    public say() {
        console.info('hello world');
    }
}

After having initialized said injector we will have to use it in a component

import { FluendoComponent } from '@fluendo/vue';

import { HelloService } from './hello.service';

@FluendoComponent({
    selector: 'flu-hello',
    withRender: '@/hello.component',
    providers: [
        HelloService,
    ],
})

export class HelloComponent {
    constructor(private readonly service: HelloService) {}
    
    public mounted(): void {
        this.service.say(); // hello world
    }
}

It is important to use the correct name with the decorator @Provide, if the name of the class is HelloService the name of the provide is helloService.

Pipes

@FluendoPipe() is the decorator that will allow us to create vue filters.

In the file capitalize.pipe.ts you create our filter:

import { FluendoPipe, IFluendoPipe } from '@fluendo/vue';

@FluendoPipe({
    name: 'capitalize',
})

export class CapitalizePipe implements IFluendoPipe {
    public action(word: string): string {
        // ...
    }
}

And to use this filter should be defined in the decorator @FluendoComponent(), in such a way:

import { FluendoComponent } from '@fluendo/vue';

import { CapitalizePipe } from './capitealize.pipe';

@FluendoComponent({
    selector: 'flu-hello',
    withRender: '@/hello.component',
    declarations: [
        CapitalizePipe,
    ],
})

export class HelloComponent {}

And in the Html:

<div>
    <span>{{ 'hello' | capitalize }}</span>
</div>
Directives

@FluendoDirective() is the decorator that will allow us to create attributes with certain concrete action.

In the file hello.directive.ts:

import { FluendoDirective, IFluendoDirective } from '@fluendo/vue';

@FluendoDirective({
    selector: 'hello',
})

export class HelloDirective implement IFluendoDirective {
    public inserted(el: HTMLElement, node: any): void {
        // ...
    }
}

And we will use it in such a way:

import { FluendoComponent } from '@fluendo/vue';

import { HelloDirective } from './hello.directive';

@FluendoComponent({
    selector: 'flu-hello',
    withRender: '@/hello.component',
    declarations: [
        HelloDirective,
    ],
})

export class HelloComponent {}

And in the Html:

<div>
    <span v-hello>hello</span>
</div>