This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const payload = { | |
spaces: [ | |
{ | |
id: '123', | |
name: 'My Space', | |
notes: [{ id: 'note_1', name: 'Note 1' }], | |
folders: [{ id: 'folder_1', name: 'Folder 1', notes: [{ id: 'note_2', name: 'Note 2' }] }] | |
projects: [ | |
{ | |
id: 'project_1', |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<template> | |
<transition | |
:enter-class="$style.Modal_slide_enter" | |
:enter-active-class="$style.Modal_slide_active" | |
:leave-active-class="$style.Modal_slide_leaveActive" | |
:leave-to-class="$style.Modal_slide_leaveTo" | |
> | |
<div | |
:class="modalClassList" | |
v-if="isOpen" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { withDesign } from 'storybook-addon-designs' | |
import { withPadding, withContainer } from '../../.storybook/helpers' | |
import VDomainCard from './VDomainCard' | |
import { domains } from './domains' | |
export default { | |
title: 'Simple Components / VDomainCard', | |
decorators: [withContainer, withPadding, withDesign] | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import axios from './axios'; | |
export const CustomerApi = { | |
async getCustomers (query = null) { | |
return await axios.get('/customers?expand=orders', { | |
params: query | |
}); | |
}, | |
async createCustomer (payload) { | |
return await axios.post('/customers', payload); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* Так как фильтр множественный, делаем так. Есть инпуты/селекты. На keydown.enter/change ебашим filterData. | |
Функция проверяет, есть ли такой фильтр уже в массиве, если нет, добавляет, если есть - проверяет, новое значение | |
пустое или нет. Если пустое - нахрен из массива, фильтр не нужен. Если не пустое - обновить значение. */ | |
methods: { | |
async filterData({target}, id) { | |
const index = this.filters.findIndex(filter => filter.key == id) | |
const keyinFilters = this.filters[index] | |
if (keyinFilters) { | |
keyinFilters.value = target.value | |
if (keyinFilters.value == '') { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import VuexPersistedState from 'vuex-persistedstate' | |
export const TestPlugin = VuexPersistedState({ | |
key: 'test', | |
storage: window.localStorage, | |
paths: ['value'] | |
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const array = [ | |
{ name: 'Alfred', ranking: 3 }, | |
{ name: 'Boris', ranking: 5 }, | |
{ name: 'Chris', ranking: 2 }, | |
{ name: 'Dylan', ranking: 1 }, | |
{ name: 'Fitzgerald', ranking: 4 } | |
] | |
const sortByRanking = () => array.sort((a, b) => a.ranking > b.ranking) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const array = [ | |
{ name: 'Alfred', ranking: 3 }, | |
{ name: 'Boris', ranking: 5 }, | |
{ name: 'Chris', ranking: 2 }, | |
{ name: 'Dylan', ranking: 1 }, | |
{ name: 'Fitzgerald', ranking: 4 } | |
] | |
const sortByRanking = () => array.sort((a, b) => a.ranking > b.ranking) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="UTF-8"> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
<meta http-equiv="X-UA-Compatible" content="ie=edge"> | |
<title>Document</title> | |
</head> | |
<body> | |
<select name="category" id="category-select"> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const path = require('path'); | |
module.exports = { | |
entry: './src/app.js', | |
output: { | |
path: path.resolve(__dirname, './public'), | |
filename: 'app.js', | |
publicPath: '/public' | |
}, | |
module: { |
NewerOlder