We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
如题,请问在vue3项目中使用kbone-ui的mp-navigation-bar组件时,如何绑定bindback事件?
已经尝试使用kbone-event-map,但是没有效果,代码如下:
<template> <mp-navigation-bar :loading.attr="mpNavigationBar.loading" :show.attr="mpNavigationBar.show.toString()" :animated.attr="mpNavigationBar.animated.toString()" :color.attr="mpNavigationBar.color" :background.attr="mpNavigationBar.background" :back.attr="true" :kbone-event-map="{bindback: () => goBack()}"> <span slot="center">微信原生</span> </mp-navigation-bar> </template> <script> import {computed, onMounted, reactive, ref, watch} from "vue"; import {useRouter} from "vue-router"; import {useStore} from "vuex"; export default { setup() { const mpNavigationBar = reactive({ loading: false, color: '#fff', background: '#1989fa', show: true, animated: false }) const goBack = (e) => { console.log(123, e) } window.addEventListener('back', (e) => { console.log(123, e) }) return { mpNavigationBar, goBack } } } </script> <style lang='less'> @primary: var(--statusbar-height); .kbone-content { width: 100%; height: calc(~"100% - 46px - @{primary}"); overflow-y: scroll; text-align: left; } </style>
The text was updated successfully, but these errors were encountered:
Sorry, something went wrong.
直接监听 back 事件试试,去掉 bind,bind 本身就是绑定的意思。
No branches or pull requests
如题,请问在vue3项目中使用kbone-ui的mp-navigation-bar组件时,如何绑定bindback事件?
已经尝试使用kbone-event-map,但是没有效果,代码如下:
The text was updated successfully, but these errors were encountered: