|
| 1 | +# vue-typed-js |
| 2 | + |
| 3 | +[ ](https://www.npmjs.com/package/vue-typed-js) |
| 4 | +[](https://vuejs.org/) |
| 5 | + |
| 6 | +A Vue.js Plugin |
| 7 | + |
| 8 | +## Table of contents |
| 9 | + |
| 10 | +- [Installation](#installation) |
| 11 | +- [Usage](#usage) |
| 12 | +- [Example](#example) |
| 13 | + |
| 14 | +# Installation |
| 15 | + |
| 16 | +``` |
| 17 | +npm install --save vue-typed-js |
| 18 | +``` |
| 19 | + |
| 20 | +## Default import |
| 21 | + |
| 22 | +Install all the components: |
| 23 | + |
| 24 | +```javascript |
| 25 | +import Vue from 'vue' |
| 26 | +import VueTypedJs from 'vue-typed-js' |
| 27 | + |
| 28 | +Vue.use(VueTypedJs) |
| 29 | +``` |
| 30 | + |
| 31 | +Use specific components: |
| 32 | + |
| 33 | +```javascript |
| 34 | +import Vue from 'vue' |
| 35 | +import { Test } from 'vue-typed-js' |
| 36 | + |
| 37 | +Vue.component('test', Test) |
| 38 | +``` |
| 39 | + |
| 40 | +**⚠️ A css file is included when importing the package. You may have to setup your bundler to embed the css in your page.** |
| 41 | + |
| 42 | +## Distribution import |
| 43 | + |
| 44 | +Install all the components: |
| 45 | + |
| 46 | +```javascript |
| 47 | +import 'vue-typed-js/dist/vue-typed-js.css' |
| 48 | +import VueTypedJs from 'vue-typed-js/dist/vue-typed-js.common' |
| 49 | + |
| 50 | +Vue.use(VueTypedJs) |
| 51 | +``` |
| 52 | + |
| 53 | +Use specific components: |
| 54 | + |
| 55 | +```javascript |
| 56 | +import 'vue-typed-js/dist/vue-typed-js.css' |
| 57 | +import { Test } from 'vue-typed-js/dist/vue-typed-js.common' |
| 58 | + |
| 59 | +Vue.component('test', Test) |
| 60 | +``` |
| 61 | + |
| 62 | +**⚠️ You may have to setup your bundler to embed the css file in your page.** |
| 63 | + |
| 64 | +## Browser |
| 65 | + |
| 66 | +```html |
| 67 | +<link rel="stylesheet" href="vue-typed-js/dist/vue-typed-js.css"/> |
| 68 | + |
| 69 | +<script src="vue.js"></script> |
| 70 | +<script src="vue-typed-js/dist/vue-typed-js.browser.js"></script> |
| 71 | +``` |
| 72 | + |
| 73 | +The plugin should be auto-installed. If not, you can install it manually with the instructions below. |
| 74 | + |
| 75 | +Install all the components: |
| 76 | + |
| 77 | +```javascript |
| 78 | +Vue.use(VueTypedJs) |
| 79 | +``` |
| 80 | + |
| 81 | +Use specific components: |
| 82 | + |
| 83 | +```javascript |
| 84 | +Vue.component('test', VueTypedJs.Test) |
| 85 | +``` |
| 86 | + |
| 87 | +## Source import |
| 88 | + |
| 89 | +Install all the components: |
| 90 | + |
| 91 | +```javascript |
| 92 | +import Vue from 'vue' |
| 93 | +import VueTypedJs from 'vue-typed-js/src' |
| 94 | + |
| 95 | +Vue.use(VueTypedJs) |
| 96 | +``` |
| 97 | + |
| 98 | +Use specific components: |
| 99 | + |
| 100 | +```javascript |
| 101 | +import Vue from 'vue' |
| 102 | +import { Test } from 'vue-typed-js/src' |
| 103 | + |
| 104 | +Vue.component('test', Test) |
| 105 | +``` |
| 106 | + |
| 107 | +**⚠️ You need to configure your bundler to compile `.vue` files.** More info [in the official documentation](https://vuejs.org/v2/guide/single-file-components.html). |
| 108 | + |
| 109 | +# Usage |
| 110 | + |
| 111 | +> TODO |
| 112 | +
|
| 113 | +# Example |
| 114 | + |
| 115 | +> TODO |
| 116 | +
|
| 117 | +--- |
| 118 | + |
| 119 | +# Plugin Development |
| 120 | + |
| 121 | +## Installation |
| 122 | + |
| 123 | +The first time you create or clone your plugin, you need to install the default dependencies: |
| 124 | + |
| 125 | +``` |
| 126 | +npm install |
| 127 | +``` |
| 128 | + |
| 129 | +## Watch and compile |
| 130 | + |
| 131 | +This will run webpack in watching mode and output the compiled files in the `dist` folder. |
| 132 | + |
| 133 | +``` |
| 134 | +npm run dev |
| 135 | +``` |
| 136 | + |
| 137 | +## Use it in another project |
| 138 | + |
| 139 | +While developping, you can follow the install instructions of your plugin and link it into the project that uses it. |
| 140 | + |
| 141 | +In the plugin folder: |
| 142 | + |
| 143 | +``` |
| 144 | +npm link |
| 145 | +``` |
| 146 | + |
| 147 | +In the other project folder: |
| 148 | + |
| 149 | +``` |
| 150 | +npm link vue-typed-js |
| 151 | +``` |
| 152 | + |
| 153 | +This will install it in the dependencies as a symlink, so that it gets any modifications made to the plugin. |
| 154 | + |
| 155 | +## Publish to npm |
| 156 | + |
| 157 | +You may have to login to npm before, with `npm adduser`. The plugin will be built in production mode before getting published on npm. |
| 158 | + |
| 159 | +``` |
| 160 | +npm publish |
| 161 | +``` |
| 162 | + |
| 163 | +## Manual build |
| 164 | + |
| 165 | +This will build the plugin into the `dist` folder in production mode. |
| 166 | + |
| 167 | +``` |
| 168 | +npm run build |
| 169 | +``` |
| 170 | + |
| 171 | +--- |
| 172 | + |
| 173 | +## License |
| 174 | + |
| 175 | +[MIT](http://opensource.org/licenses/MIT) |
0 commit comments