Neon Light plugin for Vue.js
GIF demo effect distortion,Please refer to the DEMO LIVE.
Demo >>>
- Install package via NPM
npm i -S vue-neon-light
- Install plugin within project
import VueNeonLight from 'vue-neon-light'
// In Vue Component
components:{
VueNeonLight
}
or
const VueNeonLight = request('vue-neon-light');
or
<script src="./dist/vue-neon-light.js"></script>
- Import the font file I have provided two simple font file (*.ttf) to you. One for the English (beon-webfont.ttf), the other one for the Chinese (bb1093.TTF). You can download the others font and use them which you perfer.
Copy font file into the /public
.
import VueNeonLight from 'vue-neon-light'
import fontPath from '../public/beon-webfont.ttf'
// Setting path as a variable.
export default {
name: 'app',
components: {
VueNeonLight
},
data(){
return {
font: fontPath
}
}
}
fontFile
isnecessary.
vue mode:
<div id="app">
<VueNeonLight :fontFile= "font">
Hello Sevens
</VueNeonLight>
</div>
or in script inject mode:
<div id="app">
<vue-neon-light :font-file= "font">
Hello Sevens
</vue-neon-light>
</div>
- Already done
Just two step, refresh and check the effect.
- Default: `neon`
- Acceptable-Values: String
- Function: Only support `neon` currently.
- Default: `#ff00ff`
- Acceptable-Values: String
- Function: The color setting of the Font.
- Default: `null`
- Acceptable-Values: String
- Function: The file of the font file.
- Default: `false`
- Acceptable-Values: Boolean
- Function: If `ture`, the letter will flash in random.
- Realized the basic functionality.
- Performance improvement.
- Bug Fixed.