m-loader
用于加载第三方脚本的组件
npm
npm install -S vue-m-loader
use
Vue // 注册组件 m-loader,注册方法 $loader
or
library: 'jQuery'})
MLoder Attributes
参数 | 说明 | 类型 | 可选值 | 默认值 |
---|---|---|---|---|
url | url | string | — | — |
type | 类型 | string | script/link | script |
library | 挂载window下的属性 | string | — | — |
force | 是否重新加载 | boolean | true/false | false |
$loader
// 在vue组件里使用 this
参数 | 说明 | 类型 | 可选值 | 默认值 |
---|---|---|---|---|
options.url | url | string | — | — |
options.type | 类型 | string | script/link | script |
options.library | 挂载window下的属性 | string | — | — |
options.force | 是否重新加载 | boolean | true/false | false |