Skip to content

Instantly share code, notes, and snippets.

View gearmobile's full-sized avatar
🇷🇺
Working remotely

Valeriy Semenenko gearmobile

🇷🇺
Working remotely
View GitHub Profile
@gearmobile
gearmobile / Simple Alert Vue.js
Created May 30, 2017 05:55
Simple Alert Vue.js
<template lang="pug">
#home
alert
isUseRadius = true
isUseIcon = true
ref = "alert-link"
button( type="button", @click="openWindow()" ) alert info
</template>
<script>
@gearmobile
gearmobile / Apiko - delete file no response
Created May 18, 2017 08:21
Apiko - delete file no response
<template lang="pug">
q-layout
// NAVIGATION SECTION
.toolbar( slot="header" )
q-toolbar-title( :padding="1" ) File Delete
q-tabs( slot="navigation" )
q-tab( route="/files/delete", exact, replace ) go back
// CONTAINER SECTION
@gearmobile
gearmobile / Apiko Delete File
Created May 16, 2017 13:52
Apiko Delete File
<template lang="pug">
q-layout
// NAVIGATION SECTION
.toolbar( slot="header" )
q-toolbar-title( :padding="1" ) File Delete
q-tabs( slot="navigation" )
q-tab( route="/files/delete", exact, replace ) go back
// CONTAINER SECTION
@gearmobile
gearmobile / Apiko PUT File
Created May 16, 2017 08:34
Apiko PUT File
<template lang="pug">
q-layout
// NAVIGATION SECTION
.toolbar( slot="header" )
q-toolbar-title( :padding="1" ) File Update
q-tabs( slot="navigation" )
q-tab( route="/files/put", exact, replace ) go back
// CONTAINER SECTION
<template lang="pug">
form#edit
.page-header
h2 Edit
.panel.panel-default
.panel-body
button.btn.btn-default( type="submit", @click.prevent="onEdit(customer)" ) Send Data
// CUSTOMER INFO
<template lang="pug">
#primo.primo.panel.panel-default
.panel-heading
h3.panel-title.text-center Compose New Tweet
.panel-body
form
// output section
.form-group
textarea.form-control( rows="6", placeholder="Write your tweet here", v-model="tweet" )
@gearmobile
gearmobile / apiko start log
Created May 4, 2017 14:01
apiko start log
apiko-backend|master ⇒ apiko run dev
Starting Apiko...
> [email protected] dev /Users/aarongreenberg/Projects/experiments/apiko-backend
> node main.js dev
[APIKO LOG 16:27:19.472] Connecting database...
[APIKO LOG 16:27:20.061] Database connected.
[APIKO LOG 16:27:20.062] Loading API setup...
[APIKO LOG 16:27:20.062] Looking for the API setup file... /Users/aarongreenberg/Projects/experiments/apiko-backend/apiko.json
@gearmobile
please tell me - send data in the dynamic component is somehow different from "normal" data transmission components?
the question is what - when I send data via eventBus "normal" children - all the data gets to the components.
but if I make these components dynamic data will no longer reach the components.
@gustojs
eventBus exists all the time
while dynamic components get created and destroyed
how do you send this data to the components?
# PARENT COMPONENT
<template lang="pug">
#app
.container
.row
.col-md-8.col-md-offset-2
.well
.btn-group
button.btn.btn-primary( type="button", @click="onSend" ) send data
@gearmobile
gearmobile / vue.js axios
Created April 2, 2017 16:41
vue.js axios
@gearmobile
You can't use `Vue.use(Axios)` because `Axios` isn't a vue plugin.
@gearmobile
Would need a wrapper like this: https://github.com/imcvampire/vue-axios
@gearmobile
You can just use `axios`, but you'd need to explicitly import it in every component you want it. If you use `vue-axios` you can do `this.axios` inside whatever component you want without explicitly importing it.
That's essentially what `vue-axios` does: https://github.com/imcvampire/vue-axios/blob/master/src/index.js