Skip to content

Commit

Permalink
更新api文档,插件暴露为全局变量Dialog
Browse files Browse the repository at this point in the history
  • Loading branch information
leeseean committed Jul 8, 2018
1 parent 7020169 commit 1da618f
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 3 deletions.
2 changes: 1 addition & 1 deletion build/webpack.base.conf.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ module.exports = {
app: './src/main.js'
},
output: {
path: config.build.assetsRoot,
path: config.dev.assetsRoot,
filename: '[name].js',
publicPath: _obj[process.env.NODE_ENV]
},
Expand Down
2 changes: 2 additions & 0 deletions build/webpack.dev.conf.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
'use strict'
process.env.NODE_ENV = 'development'

const utils = require('./utils')
const webpack = require('webpack')
const config = require('../config')
Expand Down
3 changes: 2 additions & 1 deletion build/webpack.plugin.conf.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,8 @@ const webpackConfig = merge(baseWebpackConfig, {
output: {
path: path.resolve(__dirname, '../plugin/dist/static'),
filename: 'js/vue.dialog.js',
libraryTarget: 'umd'
libraryTarget: 'umd',
library: 'Dialog'
},
plugins: [
// http://vuejs.github.io/vue-loader/en/workflow/production.html
Expand Down
2 changes: 1 addition & 1 deletion plugin/dist/static/js/vue.dialog.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions src/components/main.vue
Original file line number Diff line number Diff line change
Expand Up @@ -97,13 +97,17 @@
<pre>
<code>
&lt;script src="dist/dialog.js"&gt;&lt;/script&gt;
&lt;script&gt;
Vue.use(Dialog)//使用插件
&lt;/script&gt;
</code>
</pre>
<p>3.模块化引入</p>
<pre>
<code>
import Dialog from 'art-dialog-vue' //esm
const Dialog = require('art-dialog-vue') //RequireJS
Vue.use(Dialog)//使用插件
</code>
</pre>
<h2>基本用法</h2>
Expand Down

0 comments on commit 1da618f

Please sign in to comment.