@metalsadman Thank you very much! Didn’t see that when I searched.
Latest posts made by OrthoCube
-
RE: [SOLVED] Getting textarea current cursor position
-
[SOLVED] Getting textarea current cursor position
I’m trying to create my own in-app keyboard used for inputting custom characters to the textarea, however, it’s not possible to insert characters in the middle of the input by detecting the position of the cursor and inserting the character there.
Getting cursor position (and selected text position) seems to be possible in plain HTML/JS using something like this
var cursorPosition = $('#myTextarea').prop("selectionStart");
but I can’t see how I can implement that on a
<q-input>
.Is there any way to get the current cursor position (or selected position) from a q-input?
Thanks in advance.
-
RE: Choosing different layout vue files depending on platform
@rstoenescu This is just the default SPA.
this
in the routes.js file does not seem to point to Vue’sthis
so I can’t access$q
. I have found a way, by using one layout but with a couple ofv-if
s, choosing which to display based on the platform, but maybe there’s a better way to this… I just thought. -
RE: Choosing different layout vue files depending on platform
@rstoenescu Unfortunately, it seems that this is undefined even when using normal functions.
component: function () { return this.$q.platform.is.mobile ? import('layouts/MobileLayout.vue') : import('layouts/DesktopLayout.vue') },
-
Choosing different layout vue files depending on platform
I would like to use different vue layout files depending on the platform used (desktop / mobile). I thought it might be possible by modifying routes.
component: () => { this.$q.platform.is.mobile ? import('layouts/MobileLayout.vue') : import('layouts/DesktopLayout.vue') }
but it seems that $q is not accessible from the this instance from the routes. I was thinking that it’d be as simple as this but it seems it isn’t.
In the end, do I just have to use a single layout and just use v-if all over to choose what to display?
I found a post on this forum that is asking the same thing, and the answer just says that “you can use multiple layouts, you are not limited to using just one” which is true, if the path determines which layout to use (for example, www.mysite.com/mobile/posts compared to www.mysite.com/posts) but how do I use the same path but choose which layout to use depending on platform?
Thanks in advance.