1
0
mirror of https://github.com/PanJiaChen/vue-element-admin.git synced 2025-08-12 06:15:45 +08:00
Yamel Senih f45a57178a
Feature/#doc add documentation (#798)
* Add support to x vversion from npm

* Add support to x vversion from npm

* Add support to x vversion from npm

* Add documentation for current repository
2021-04-29 12:23:48 -04:00

64 lines
1.3 KiB
Markdown
Executable File

# Import Third-party Modules
In addition to the element-ui components and the business components built into the scaffolding, sometimes we also need to import other external components.
Here to import [vue-count-to](https://github.com/adempiere/vue-countTo) as an example to introduce.
## Install dependence
Enter the following command in the terminal to complete the installation:
```bash
$ npm install vue-count-to --save
```
> add `--save` will automatically add dependencies to package.json.
<br/>
## Usage
### Global Registration
**main.js**
```js
import countTo from 'vue-count-to'
Vue.component('countTo', countTo)
```
```html
<template>
<countTo :startVal='startVal' :endVal='endVal' :duration='3000'></countTo>
</template>
```
### Local Registration
```html
<template>
<countTo :startVal='startVal' :endVal='endVal' :duration='3000'></countTo>
</template>
<script>
import countTo from 'vue-count-to';
export default {
components: { countTo },
data () {
return {
startVal: 0,
endVal: 2017
}
}
}
</script>
```
![](https://adempiere-vue.gitee.io/gitee-cdn/adempiere-vue-site/8b95fac0-6691-4ad6-ba6c-e5d84527da06.gif)
<br/>
## Use Any Javascript Library With Vue.js
[Use Any Javascript Library With Vue.js](https://vuejsdevelopers.com/2017/04/22/vue-js-libraries-plugins/)