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> | |
<div> | |
<div class="date-examples"> | |
<div> | |
<DatePicker | |
v-model="date" | |
:is-range="isRange" | |
:model-config="modelConfig" | |
is-required | |
> |
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
// Making post request using axios (with headers too) | |
axios | |
.post('localhost', payload, { | |
headers: { | |
'Content-Type': 'application/json', | |
Authorization: 'Bearer ' + token, | |
}, | |
}) | |
.then(function (response) { | |
console.log(response) |
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> | |
<input type="file" @change="handleFileUpload($event)"/> | |
</template> | |
<script> | |
import axios from 'axios' | |
import { reactive, toRefs } from 'vue' | |
export default { |
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
// It's just a piece of code. | |
const token = VueCookieNext.getCookie('token') | |
let formData = new FormData() | |
const state = reactive({ | |
photo: null, | |
}) | |
formData.append('name', fullName.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
<p class="mb-1 text-brand-mainDark"> | |
Select state | {{selectedState}} | |
</p> | |
<Multiselect | |
placeholder="Select state" | |
:minChars="1" | |
:required="true" | |
autocomplete="undefined" | |
v-model="selectedState" |
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
// comparing by id | |
const output = yourFirstArray.filter((item1) => !yourSecondArray.some((item2) => item1.id == item2.id)) | |
console.log(output) | |
// or | |
// attention: "id" is a variable of yourFirstArray filter method | |
const output = yourFirstArray.filter(({ id }) => !yourSecondArray.find(item => item.id == id)); | |
console.log(output); |
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 searchEntities = ref('') | |
const searchActions = ref('') | |
const loadingTable = ref(false) | |
const loadingRegister = ref(false) | |
const singleTable = ref(null) | |
const newEntity = ref(false) | |
const entityName = ref('') | |
const newAction = ref(false) | |
const actionName = ref('') |
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
// first of all: props are for parent -> child and we can use emit for child -> parent | |
// parent-component.vue | |
<card-stats | |
@goalReachedPercentage="getReachedGoalValue" | |
/> | |
const getReachedGoalValue = (percent) => { | |
datas.indicatorGoalPercentage.push(percent) |
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> | |
<DatePicker | |
v-model="range" | |
:model-config="modelConfig" | |
:startDate="startDate" | |
:endDate="endDate" | |
is-range | |
is-required | |
color="green" | |
> |
OlderNewer