Navigation

    Quasar Framework

    • Register
    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    1. Home
    2. jonathan_on
    3. Posts
    • Profile
    • Following 0
    • Followers 0
    • Topics 4
    • Posts 8
    • Best 0
    • Groups 0

    Posts made by jonathan_on

    • How listener for Permissions change with capacitor

      I need to watch when Permissions change, in case the user change the permission mannualy in configurations. In Capacitor documentation of Permissions is mencioned the method addListener, but with no examples or list of possible listeners:

      addListener(eventName: string, listenerFunc: Function): PluginListenerHandle
      

      I try various string in eventName, but no one works. Someone can help?

      posted in Framework
      jonathan_on
      jonathan_on
    • RE: Prevent Android backbutton using Capacitor not working

      @metalsadman Which hook do you use? I added the event both in created() and outside the default export, inside a deviceready listener. In both the log is displayed, but the screen is closed nonetheless.

      posted in Framework
      jonathan_on
      jonathan_on
    • Prevent Android backbutton using Capacitor not working

      Hello guys, if anyone can help me, I will be grateful.
      I am developing an application for Android with Quasar and Capacitor, and on a specific screen that will synchronize with the backend, I would like that when the user clicks the physical back button on the device, I can display an alert asking if he would really like stop syncing and exit.
      Using both the capacitor’s App plugin and the native event, they are triggered but do not prevent the return to the previous route. I am testing in a Samsung tablet SM-T290 with Android 10.

      import { Plugins } from "@capacitor/core";
      const { App } = Plugins;
      
      App.addListener('backButton', () => {
          console.log('Blocked');
      });
      
      document.addEventListener('backbutton', function(event) {
          event.preventDefault();
          event.stopPropagation();
          console.log('Not work...');
       }, false);
      
      posted in Framework
      jonathan_on
      jonathan_on
    • Q-toggle does not accept custom color

      I created a custom color variable, as indicated in the documentation, and managed to use it in several components, but in q-toggle it doesn’t work, when I try, it just ignores it.

      boot.js:

      import {colors} from "quasar";
      
      colors.setBrand('mycolor', '#ff4e0f');
      

      quasar.variables.sass:

      $mycolor: #FF4E0F
      
      <q-toggle color="mycolor" keep-color v-model="dark" @input="changeDarkMode" />
      <q-btn label="Test" color="mycolor" />
      

      Anotação 2020-07-16 180129.png

      posted in Framework
      jonathan_on
      jonathan_on
    • RE: Setting dark mode does not save, always returns to automatic when reopening the app

      @metalsadman Sorry! In any way, both in the browser when refreshing and in the device, closing and opening again. But I followed your tip, thanks.

      posted in Framework
      jonathan_on
      jonathan_on
    • RE: Setting dark mode does not save, always returns to automatic when reopening the app

      @metalsadman I thought about it, but I thought that somehow the plugin maintained the state on its own.

      posted in Framework
      jonathan_on
      jonathan_on
    • Setting dark mode does not save, always returns to automatic when reopening the app

      I’m deploying dark mode, but when testing on the device, it starts on automatic, so I change using this.$q.dark.set(true), however when closing and reopening the application, it always returns to the default, in the false case . Am I wrong in some configuration?

      <template>
          <q-layout view="lHh Lpr lFf">
              <q-list :dark="dark">
                  <q-item
                       tag="label"
                       v-ripple
                  >
                  	<q-item-section>
                  		<q-item-label>Dark theme</q-item-label>
                 	</q-item-section>
                  	<q-item-section side >
                  		<q-toggle v-model="dark" @input="changeDarkMode" />
                  	</q-item-section>
                  </q-item>
              </q-list>
          </q-layout>
      </template>
      
      <script>
      export default {
      	name: 'MainLayout',
      	created() {
      		this.dark = this.$q.dark.isActive;
      	},
      	watch: {
      		'$q.dark.isActive' (val) {
      			this.dark = val;
      		}
      	},
      	data() {
      		return {
      			dark: null
      		}
      	},
      	methods: {
      		changeDarkMode(value) {
      			this.dark = value;
      			this.$q.dark.set(value);
      		}
      	}
      }
      </script>
      

      And, in my quasar.conf.js:

      config: {
      	dark: 'auto' // or Boolean true/false
      }
      

      I appreciate the help.

      posted in Framework
      jonathan_on
      jonathan_on