Browse Source

修改use的问题

tags/1.7.5
Caven Chen 5 years ago
parent
commit
f5ed6376df
3 changed files with 5 additions and 5 deletions
  1. 1
    1
      src/base/global-api/mixin.js
  2. 3
    3
      src/base/global-api/use.js
  3. 1
    1
      webpack.config.js

+ 1
- 1
src/base/global-api/mixin.js View File

@@ -2,7 +2,7 @@
* @Author: Caven
* @Date: 2020-05-09 23:00:54
* @Last Modified by: Caven
* @Last Modified time: 2020-05-09 23:20:56
* @Last Modified time: 2020-06-17 17:30:58
*/
export function initMixin(DC) {
DC.mixin = function(mixin) {

+ 3
- 3
src/base/global-api/use.js View File

@@ -2,18 +2,18 @@
* @Author: Caven
* @Date: 2020-05-09 23:01:21
* @Last Modified by: Caven
* @Last Modified time: 2020-05-11 23:55:03
* @Last Modified time: 2020-06-17 17:41:24
*/

export function initUse(DC) {
DC.use = plugin => {
DC.use = function(plugin) {
const installedPlugins =
this._installedPlugins || (this._installedPlugins = [])
if (installedPlugins.indexOf(plugin) > -1) {
return this
}
// additional parameters
const args = toArray(arguments, 1)
const args = []
args.unshift(this)
if (typeof plugin.install === 'function') {
plugin.install.apply(plugin, args)

+ 1
- 1
webpack.config.js View File

@@ -2,7 +2,7 @@
* @Author: Caven
* @Date: 2020-01-18 18:22:23
* @Last Modified by: Caven
* @Last Modified time: 2020-06-15 09:38:43
* @Last Modified time: 2020-06-17 13:29:50
*/

const path = require('path')

Loading…
Cancel
Save