项目原始demo,不改动
Vous ne pouvez pas sélectionner plus de 25 sujets Les noms de sujets doivent commencer par une lettre ou un nombre, peuvent contenir des tirets ('-') et peuvent comporter jusqu'à 35 caractères.
Ce dépôt est archivé. Vous pouvez voir les fichiers et le cloner, mais vous ne pouvez pas pousser ni ouvrir de ticket/demande d'ajout.
 
 
 
 

69 lignes
1.5 KiB

  1. import { factory as PositionableFactory } from '../positionable'; // Util
  2. import mixins from '../../util/mixins';
  3. export default function applicationable(value, events = []) {
  4. /* @vue/component */
  5. return mixins(PositionableFactory(['absolute', 'fixed'])).extend({
  6. name: 'applicationable',
  7. props: {
  8. app: Boolean
  9. },
  10. computed: {
  11. applicationProperty() {
  12. return value;
  13. }
  14. },
  15. watch: {
  16. // If previous value was app
  17. // reset the provided prop
  18. app(x, prev) {
  19. prev ? this.removeApplication(true) : this.callUpdate();
  20. },
  21. applicationProperty(newVal, oldVal) {
  22. this.$vuetify.application.unregister(this._uid, oldVal);
  23. }
  24. },
  25. activated() {
  26. this.callUpdate();
  27. },
  28. created() {
  29. for (let i = 0, length = events.length; i < length; i++) {
  30. this.$watch(events[i], this.callUpdate);
  31. }
  32. this.callUpdate();
  33. },
  34. mounted() {
  35. this.callUpdate();
  36. },
  37. deactivated() {
  38. this.removeApplication();
  39. },
  40. destroyed() {
  41. this.removeApplication();
  42. },
  43. methods: {
  44. callUpdate() {
  45. if (!this.app) return;
  46. this.$vuetify.application.register(this._uid, this.applicationProperty, this.updateApplication());
  47. },
  48. removeApplication(force = false) {
  49. if (!force && !this.app) return;
  50. this.$vuetify.application.unregister(this._uid, this.applicationProperty);
  51. },
  52. updateApplication: () => 0
  53. }
  54. });
  55. }
  56. //# sourceMappingURL=index.js.map