vue-fake-data
v1.0.0
Published
a vuejs plugin to generate fake data
Downloads
7
Maintainers
Readme
vue-fake-data
a vuejs plugin to generate realistic fake data
installation
npm i vue-fake-data --save
How to use
import vueFakeData from 'vueFakeData'
Vue.use(vueFakeData,{locale: 'eng'})
Global Object
### available Global Object
Vue.$DataFaker
Example
<template>
<div id="app">
<p>Hey,my address is {{fakeStreetAddress}}, {{fakeCity}} :)</p>
</div>
</template>
<script>
export default {
name: 'app',
computed:{
fakeCity:function(){
return this.$DataFaker.address.city();
},
fakeStreetAddress:function(){
return this.$DataFaker.address.streetAddress();
},
}
}
</script>
directives
dataFaker: help you to generate Fake data such as names and emails ...
imageFaker: you can use it with
<img>
tag to change thesrc
attr to a random imag url
Example:
<template>
<div id="app">
<p > Hi! my name is : <span v-dataFaker:name="firstName"></span> </p>
<p > and this is my best picture ever: </p> <img height="100px" width="100px" v-imageFaker="avatar" />
</div>
</template>
<script>
export default {
name: 'app',
}
</script>
Components
soon...