8_9 中文文档教程
8_9
< img src="https://img.shields.io/npm/dm/8_9.svg" alt="npm">
一个 Vue.js 插件
Table of contents
Installation
npm install --save 8_9
Default import
安装所有组件:
import Vue from 'vue'
import 8_9 from '8_9'
Vue.use(8_9)
使用特定组件:
import Vue from 'vue'
import { Test } from '8_9'
Vue.component('test', Test)
⚠️ 导入包时包含一个 css 文件。 您可能必须设置您的捆绑器以将 css 嵌入您的页面。
Distribution import
安装所有组件:
import '8_9/dist/8_9.css'
import 8_9 from '8_9/dist/8_9.common'
Vue.use(8_9)
使用特定组件:
import '8_9/dist/8_9.css'
import { Test } from '8_9/dist/8_9.common'
Vue.component('test', Test)
⚠️ 您可能必须设置您的捆绑器以将 css 文件嵌入您的页面。 strong>
Browser
<link rel="stylesheet" href="8_9/dist/8_9.css"/>
<script src="vue.js"></script>
<script src="8_9/dist/8_9.browser.js"></script>
该插件应该是自动安装的。 如果没有,您可以按照以下说明手动安装它。
安装所有组件:
Vue.use(8_9)
使用特定组件:
Vue.component('test', 8_9.Test)
Source import
安装所有组件:
import Vue from 'vue'
import 8_9 from '8_9/src'
Vue.use(8_9)
使用特定组件:
import Vue from 'vue'
import { Test } from '8_9/src'
Vue.component('test', Test)
⚠️ 您需要配置您的捆绑器来编译 .vue
文件。 更多信息 在官方文档中。
Usage
TODO
Example
TODO
Plugin Development
Installation
第一次创建或克隆插件时,需要安装默认依赖项:
npm install
Watch and compile
这将以监视模式运行 webpack,并将编译后的文件输出到 dist
文件夹中。
npm run dev
Use it in another project
在开发时,您可以按照插件的安装说明将其链接到使用它的项目中。
在插件文件夹中:
npm link
在其他项目文件夹中:
npm link 8_9
这会将它作为符号链接安装在依赖项中,以便它获得对插件所做的任何修改。
Publish to npm
您之前可能必须使用 npm adduser
登录到 npm。 该插件将在生产模式下构建,然后在 npm 上发布。
npm publish
Manual build
这将在生产模式下将插件构建到 dist
文件夹中。
npm run build
License
8_9
A Vue.js Plugin
Table of contents
Installation
npm install --save 8_9
Default import
Install all the components:
import Vue from 'vue'
import 8_9 from '8_9'
Vue.use(8_9)
Use specific components:
import Vue from 'vue'
import { Test } from '8_9'
Vue.component('test', Test)
⚠️ A css file is included when importing the package. You may have to setup your bundler to embed the css in your page.
Distribution import
Install all the components:
import '8_9/dist/8_9.css'
import 8_9 from '8_9/dist/8_9.common'
Vue.use(8_9)
Use specific components:
import '8_9/dist/8_9.css'
import { Test } from '8_9/dist/8_9.common'
Vue.component('test', Test)
⚠️ You may have to setup your bundler to embed the css file in your page.
Browser
<link rel="stylesheet" href="8_9/dist/8_9.css"/>
<script src="vue.js"></script>
<script src="8_9/dist/8_9.browser.js"></script>
The plugin should be auto-installed. If not, you can install it manually with the instructions below.
Install all the components:
Vue.use(8_9)
Use specific components:
Vue.component('test', 8_9.Test)
Source import
Install all the components:
import Vue from 'vue'
import 8_9 from '8_9/src'
Vue.use(8_9)
Use specific components:
import Vue from 'vue'
import { Test } from '8_9/src'
Vue.component('test', Test)
⚠️ You need to configure your bundler to compile .vue
files. More info in the official documentation.
Usage
TODO
Example
TODO
Plugin Development
Installation
The first time you create or clone your plugin, you need to install the default dependencies:
npm install
Watch and compile
This will run webpack in watching mode and output the compiled files in the dist
folder.
npm run dev
Use it in another project
While developping, you can follow the install instructions of your plugin and link it into the project that uses it.
In the plugin folder:
npm link
In the other project folder:
npm link 8_9
This will install it in the dependencies as a symlink, so that it gets any modifications made to the plugin.
Publish to npm
You may have to login to npm before, with npm adduser
. The plugin will be built in production mode before getting published on npm.
npm publish
Manual build
This will build the plugin into the dist
folder in production mode.
npm run build