vue-faker

3.0.0 • Public • Published

vue-faker

Vue plugin that wraps the node fake data generator, faker.

Installation

You can install this plugin through NPM

npm install vue-faker

And then register the plugin with Vue.

Vue.use(require('vue-faker'));

Usage

You now access the faker library using the following command

Vue.faker().name.firstName()

Or from within a Vue component

this.$faker().name.firstName()
...
data() {
    return {
      name: this.$faker().name.findName(),
      email: this.$faker().internet.email(),
      company: this.$faker().company.companyName(),
    }
},
...

Locale

You can set the loacle globally by passing it through as an option to the plugin

Vue.use(require('vue-faker'), {locale: 'en_GB'});

Readme

Keywords

Package Sidebar

Install

npm i vue-faker

Weekly Downloads

2,295

Version

3.0.0

License

ISC

Unpacked Size

1.97 kB

Total Files

3

Last publish

Collaborators

  • brockreece