Welcome to mirror list, hosted at ThFree Co, Russian Federation.

url_sync.vue « components « vue_shared « javascripts « assets « app - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 2844d9e9e9460111650ca66b61cf6f45c3a7bb77 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
<script>
import { historyPushState } from '~/lib/utils/common_utils';
import { mergeUrlParams } from '~/lib/utils/url_utility';

export default {
  props: {
    query: {
      type: Object,
      required: true,
    },
  },
  watch: {
    query: {
      immediate: true,
      deep: true,
      handler(newQuery) {
        historyPushState(mergeUrlParams(newQuery, window.location.href, { spreadArrays: true }));
      },
    },
  },
  render() {
    return this.$slots.default;
  },
};
</script>