Skip to content
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-navigation-toggle not working for Vue.js apps #10845

Closed
raimund-schluessler opened this issue Aug 24, 2018 · 3 comments
Closed

App-navigation-toggle not working for Vue.js apps #10845

raimund-schluessler opened this issue Aug 24, 2018 · 3 comments

Comments

@raimund-schluessler
Copy link
Member

The app-navigation toggle button which is visible for small screensizes does not work with Vue.js apps. This is because the event handler for this button is bound by jQuery before the Vue app loaded. Vue.js apps remove all event handlers from elements within their scope, so the snapjs handler is never triggered when the button is clicked.

I packed a small vue.js app to demonstrate the problem. It does nothing else then showing the problem. Just unpack it in your app folder, activate it and reduce the window size below 768 px width to show the app-navigation-toggle button. Then click the button and see that the app navigation menu does not appear.

I guess we have to load the vue.js app first and then bind the event handler for the button. Or handle it in vue and provide a function which the app can call to show the menu. But maybe @skjnldsv has a better idea.

vuetest.tar.gz

@nextcloud-bot
Copy link
Member

GitMate.io thinks possibly related issues are #9767 (Vue apps issues), #9938 (Vue settings apps), #8991 (Right-click and »open in new tab« does not work for app navigation), #7801 (Nextcloud Talk APP NOT Working), and #4827 (App description not available for local apps).

@raimund-schluessler
Copy link
Member Author

From lookin at https://github.com/nextcloud/contacts/tree/vue I realized that this does not happen when

<div id="content" class="app-vuetest">
</div>

is inside a vue template. Then the jQuery only runs when the Vue app is already rendered and the event handlers are not removed by vue.js anymore.

@skjnldsv
Copy link
Member

skjnldsv commented Aug 25, 2018

Yeah, you need to have the app-content too for the snapjs to work.
And the root of your app still needs to fit the structure requirements :)

https://github.com/nextcloud/contacts/blob/0b5f975b5288e1a9548260f9ac8f47453982f9a7/src/views/Contacts.vue#L24

<div id="content" class="app-settings" :class="{ 'with-app-sidebar': currentApp}">

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants