Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • Jan 31 2019 22:22
    visualfanatic edited #9403
  • Jan 31 2019 22:04
    visualfanatic opened #9403
  • Jan 31 2019 18:25

    yyx990803 on regression-test

    fix: allow more enumerated valu… chore: update sponsors [ci skip… fix: fix v-bind:style for camel… and 1 more (compare)

  • Jan 31 2019 17:29
    yyx990803 closed #9402
  • Jan 31 2019 17:20
    devedse opened #9402
  • Jan 31 2019 16:49
    Justineo closed #9401
  • Jan 31 2019 16:40
    Giwayume opened #9401
  • Jan 31 2019 15:24
    yyx990803 closed #9396
  • Jan 31 2019 15:24

    yyx990803 on dev

    fix: fix child forceUpdate regr… (compare)

  • Jan 31 2019 15:08
    yyx990803 closed #9382
  • Jan 31 2019 15:08

    yyx990803 on dev

    fix: fix v-bind:style for camel… (compare)

  • Jan 31 2019 15:08
    yyx990803 closed #9386
  • Jan 31 2019 15:04

    yyx990803 on dev

    chore: update sponsors [ci skip… (compare)

  • Jan 31 2019 15:04

    yyx990803 on patreon-update-1548947041032

    (compare)

  • Jan 31 2019 15:04
    yyx990803 closed #9400
  • Jan 31 2019 15:04

    vue-bot on patreon-update-1548947041032

    chore: update sponsors [ci skip] (compare)

  • Jan 31 2019 15:04
    vue-bot opened #9400
  • Jan 31 2019 14:59

    yyx990803 on patreon-update-1548924868622

    (compare)

  • Jan 31 2019 14:58
    yyx990803 closed #9393
  • Jan 31 2019 14:56

    yyx990803 on dev

    fix: allow more enumerated valu… (compare)

Neil Duffy
@skiv71
couldn't see you accessing this.$store in it though
Jennifer Eberlei
@jennifer.eberlei_gitlab
I did that before but it said its undefined, now it just says "$store" is undefined. I googled a bit and it said I have to use a watcher for accessing the data within my function but I am basically learning by doing here right now. lol
Neil Duffy
@skiv71
you cannot use arrow for vue functions where you expect 'this' to be available
i don't use vuex, just not necessary, but you need std functions, so vue can bind them
Jennifer Eberlei
@jennifer.eberlei_gitlab
I will try that thank you
rufaidulk
@rufaidulk
Hi
I am building laravel vuejs app.I have two vue instance, one for admin and other for normal user. I am using vuex store for state management, handling authentication etc. Both stores are in different folder. Now the problem is when i logged in first app, am getting logged in second app also. How can i solve this
Jennifer Eberlei
@jennifer.eberlei_gitlab
Does anybody have experience with vue-functional-datepicker?
for some reason when I select the option to use "daterange" together with datepicker I can't select just 1 day. I need the ability to select 1 day or date-range.
Jennifer Eberlei
@jennifer.eberlei_gitlab
I have this function - can somebody tell me how to optimize it?
 /**
     * filteredDates
     * @date 2020-11-29
     * @param {String} start - expects Date Object.
     * @param {String} end - expects Date Object.
     * @returns {Array} - returns filtered Array.
     */
    filteredDates(start, end) {
      const fullRange = getDatesBetweenRange(start, end);
      console.log(fullRange);
      const disabledDates = [];
      const datesWithoutWeekend = [];
      let clearedArray = [];

      // convert the date-strings to actual Date() so we can
      // compare them
      [...this.holidays].forEach((date) => {
        disabledDates.push(convertDateStringToDate(date));
      });

      // check for weekends
      [...fullRange].forEach((date) => {
        console.log('filteredDates ', date);
        if (!date.getDay() === 6 || !date.getDay() === 0) {
          datesWithoutWeekend.push(date);
        }
      });

      // filter disabled Dates
      [...datesWithoutWeekend].forEach((date) => {
        clearedArray = datesWithoutWeekend.filter((date) => !disabledDates.includes(date));
      });

      console.log('clearedArray:\n', clearedArray);

      return clearedArray;
    },
right now when I am at the part where it's supposed to check for weekends I run into a memory issue, which I don't know why
Neil Duffy
@skiv71
@jennifer.eberlei_gitlab I use pikaday, not found a single vue based component library that's necessary
regarding optimization, wherever you end up using .forEach, map, reduce will almost always produce a more readable, maintainable and performant piece of code :smile:
to optimize your snippet, an 'english' explanation of its true purpose will yield a better answer
Neil Duffy
@skiv71
oh, and since your filtering 'map, filter, reduce' - all good JS coders need to master these
Jennifer Eberlei
@jennifer.eberlei_gitlab

thank you very much for your reply.

I have the following situation:
I have to create a "vacation-request" calendar, where a user can either select a single date or a date-range. Weekends should be disabled and also public holidays (which I get from API)
Since I am using vue-functional-datepicker for now; when I select a date-range I have the start- and end-date available, but I have to manually check whether the days in between that range are possible selections or not. Therefore I created some functions which help me sorting that out, so when I send the request to the db, only the days allowed get send.

I have updated my function so far to this:
  getDatesBetweenRange(startDate, endDate) {
      let dates = [];
      // to avoid modifying the original date
      const theDate = new Date(startDate);
      const disabledDates = this.holidaysConverted;
      const filteredArray = []; // array which will hold output of filtered dates

      /* eslint no-unmodified-loop-condition: "off" */
      while (theDate < endDate) {
        // filter weekends out of array
        if (theDate.getDay() === 6 || theDate.getDay() === 0) {
        } else {
          dates = [...dates, new Date(theDate)];
        }
        theDate.setDate(theDate.getDate() + 1);
      }
      dates = [...dates, endDate];
      [...dates].forEach((date) => {
        // filter holidays out of our array
        for (let i = 0; i < disabledDates.length; ++i) {
          if (date.getTime() !== disabledDates[i].getTime()) {
            filteredArray.push(date);
          } else {
            console.log(
              'appears in disabledDates:\n',
              date,
              disabledDates[i],
              date.getTime() === disabledDates[i].getTime()
            );
          }
        }
      });
      console.log('filteredArray\n', filteredArray);
      return filteredArray;
    },
but for some reason it still puts the 24th of December into my filtered array, even though I also get an output in the else condition, which is startling me a bit.
Z
@sdrkyj
wow, a holidays API? In China, I've searched for such thing, but none
Jennifer Eberlei
@jennifer.eberlei_gitlab
well somebody built a script that gates public holidays from Wikipedia and returned them as json. Maybe somebody can apply that...
https://feiertage-api.de/
this is for german holidays though
Z
@sdrkyj
Thanks for a reply. btw, the Vue chat has moved to Discord. https://vue.land
Falgun Swami
@swamifalgun
Hi, can anyone with experience with gridsome tell me how I can implement scrollbehavior in gridsome project. thanks !
Norman
@nkoehring
@swamifalgun you get a router instance in your initialization file (main.js). So you can do something there.
Falgun Swami
@swamifalgun
@nkoehring I have the router instance there. But I can not get scroll position from it. using vue-scroll-behaviour-
Norman
@nkoehring
export default function (Vue, { router, head, isClient }) {
  /* gridsome stuff */
  // overwrite the scrollBehavior function
  router.options.scrollBehavior = function(to, from, savedPosition) {
    /* your custom logic */
  })
}
Falgun Swami
@swamifalgun
i am trying the same approach. but the savedPosition is always undefined.
router.options.scrollBehavior = function(to, from , savedPosition) {

    if (savedPosition) {
      return  savedPosition;
    }
    if (to.hash) {
      return {selector: to.hash};
    }
    return {x: 0, y: 0}
  }
basically I do not want to make use of the hash and instead is it possible to make use of scrollPosition ?
Norman
@nkoehring
oh, hmm, maybe it would help to quickly create a codesandbox with a minimal version to test it out.
Falgun Swami
@swamifalgun
@nkoehring with my code ? (sorry never used this before)
Falgun Swami
@swamifalgun
Neil Duffy
@skiv71
@jennifer.eberlei_gitlab sent u PM
blueto01h
@blueto01h
hey all, could someone please help me real quick with testing a component? ive specified a props data field in the mounting option but the data is undefined in the components "beforeMount" function. works fine outside the test file though. im pretty new to this
Mark Brown
@markwbrown
is anybody aware of a orphan/widow fix library?
Simon Shine
@sshine
Is there a gitter for VuePress, or is that covered here, too?
Simon Shine
@sshine
Oh, the topic says that this chat has migrated to http://chat.vuejs.org/ :) Easy to overlook.
Norman
@nkoehring
Yes, they have a room for VuePress as well
Abraham Milano
@amilano

Greetings everyone!!!

I'm relatively new to vue and I'm jumping into a project that was already started by somebody else who's no longer in the company I work for. This person created two vue projects, one of the projects (let's call it project A) uses the second project (project B) as a module... in project B import paths are defined using "@" (import SomeComponent from "@/components/SomeComponent.vue";).

When importing in project A a component from the module (project B) the components imports are trying to find its dependencies from the root of project A instead of inside it's own root. Is there a way to fix this that doesn't involve changing project B's imports to use relative paths (../)?

cf Gg
@ggcfo0o123_gitlab
Hi Guys~
May I know what does this line of code mean?
const remainingGrid = this.grid.find(grid1 => !grid1.isOpen && !grid1.hasFlag);
console.log(remainingGrid);
if (!remainingGrid) {
this.finished = true;
this.won = true;
this.start123 = false;
console.log(123);
}
jiangkeyuan
@jiangkeyuan
hallo
vue3 Component library?
ojabi
@ojabi
Is this room still in use?
Topic says to use disocrd
Norman
@nkoehring
This room is not the official chat anymore @ojabi but it is in use.
@ggcfo0o123_gitlab which of al lthe lines do you mean?
And btw, there is code highlighting here:
const remainingGrid = this.grid.find(grid1 => !grid1.isOpen && !grid1.hasFlag);
console.log(remainingGrid);
if (!remainingGrid) {
  this.finished = true;
  this.won = true;
  this.start123 = false;
  console.log(123);
}
Goleven
@Goleven
I'm trying to create a template with webpack+ vue3+ typescript, the repo is here(https://github.com/Goleven/vue-webpack-typescript-template), bu the component has not been mounted, and can someone give me some advice, thanks.
Norman
@nkoehring
@Goleven I can't see anything obviously wrong there but that could just be the pre-coffee me not seeing it. I suggest you to try to eliminate noise by reducing the webpack config to a minimum and see if/when it fails. In case you want it easy-going and screw manual webpack configuration: there's a vue3-plugin for vue-cli and there is also vite, the latter a bit more experimental.
Goleven
@Goleven
@nkoehring OK, tanks for your reply, I just want to create a project manually, without any cli, and then to know it better