-
Notifications
You must be signed in to change notification settings - Fork 112
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
能否提供一个 es6 的 module 用来 import ? #42
Comments
可以说说是怎样的拓展吗?现在还不太明白 |
比如 import Vue from 'vue'
import { vTapOnlyDirective } from 'vue-tap'
const vTapExtended = dosomething(vTapExtended)
Vue.directive('vTap', vTapExtended) 或者我只想某个 single component file 用这个 directive 的时候。 |
类似 import VueTap from './VueTap'
export function install (Vue) {
Vue.directive('tap', VueTap)
}
export {
VueTap
}
/* -- Plugin definition & Auto-install -- */
/* You shouldn't have to modify the code below */
// Plugin
const plugin = {
/* eslint-disable no-undef */
version: VERSION,
install,
}
export default plugin
// Auto-install
let GlobalVue = null
if (typeof window !== 'undefined') {
GlobalVue = window.Vue
} else if (typeof global !== 'undefined') {
GlobalVue = global.Vue
}
if (GlobalVue) {
GlobalVue.use(plugin)
} Copied from https://github.com/Akryum/vue-share-components |
可以把 vue1 vue2 版本的都 export 出来,方便 webpack2 做 tree-shaking。 |
分别export是可以,不过本身也没多大,tree也少不了多少K。拓展的话,就一个tap指令有什么需要拓展的么?有什么需要,还不如我开放个配置接口更方便 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
现在你把 install 合在一起的,不能只 import directive,不方便扩展。
The text was updated successfully, but these errors were encountered: