-
Notifications
You must be signed in to change notification settings - Fork 131
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
项目中自己封装了插件,如果在 App() 中调用插件方法呢? #30
Comments
前阵子刚好加了
|
对的!太及时了! |
插件在 export function mixin() {
function setup() {
this.$request = request
this.$login = login
this.$loading = loading
}
return {
beforeLoad: setup,
created: setup,
}
}
const Plugin = {
install({ App, Page, Component }) {
App.mixin(mixin())
Page.mixin(mixin())
Component.mixin(mixin())
},
}
export default Plugin 这样的写法在 App.define({
onLaunch() {
this.$login()
}
}) 提示 |
export function mixin() {
function setup() {
this.$request = request
this.$login = login
this.$loading = loading
}
return {
+ onLaunch: setup,
beforeLoad: setup,
created: setup,
}
} 这样呢? |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
现在
App()
貌似不在 tina 中,如何在App()
调用封装的插件方法呢?The text was updated successfully, but these errors were encountered: