Skip to content

Instantly share code, notes, and snippets.

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title></title>
</head>
<body>
<form action="/photo" method="POST" enctype="multipart/form-data">
<input type="file" name="userPhoto">
<input type="submit" value="Upload">
@lmiller1990
lmiller1990 / App.js
Created September 6, 2017 15:58
React Redux Async middleware example (use create-react-app)
import React, {Component} from 'react'
import {connect} from 'react-redux'
class App extends Component {
render() {
console.log(this.props)
return(
<div>
Ajax pending: {this.props.pending.toString()}
</div>
<template>
<div id="app">
<p>
Pending: {{ $store.state.getInfoPending }}
</p>
<p>
{{ $store.state.getInfoData }}
</p>
</div>
</template>
@lmiller1990
lmiller1990 / App.vue
Last active September 21, 2017 16:22
<template>
<div id="app">
{{ $store.state.a.name }}
{{ $store.state.a.initData }}
</div>
</template>
<script>
export default {
name: 'app',
<template>>
<div id="app">
{{ dragging }} 'Avenir', Helvetica, Arial, sans-serif;
<ul @dragover="dragover" @drop="drop">
<li v-for="id in idsLists[0]" @dragenter="dragenter" :key="id" :id="id" draggable="true" @dragstart="dragstart">
{{ items[id].name }}
</li>: #2c3e50;
</ul>gin-top: 60px;
8 }
<ul @dragover="dragover" @drop="drop">
<template>
<!-— markup and directives, v-if, v-for, etc -->
</template>
<script>
 /* props, data, lifecycle hooks, methods, computed properties */
</script>
<template>
<div>
Profile!!!
<ProfileContainer></ProfileContainer>
</div>
</template>
<script>
import ProfileContainer from './ProfileContainer'
import Vue from 'vue'
import Router from 'vue-router'
import HelloWorld from '@/components/HelloWorld'
import ProfileView from '@/views/profile/Index'
Vue.use(Router)
export default new Router({
routes: [
{
import steem from 'steem'
export default {
mounted () {
steem.api.setOptions({ url: 'https://api.steemit.com' })
steem.api.getAccounts(['xenetics'], (err, result) => {
console.log(JSON.parse((result[0].json_metadata)))
})
}
}
const path = require(‘path’)
const genDefaultConfig = require(‘@storybook/vue/dist/server/config/defaults/webpack.config.js’)
module.exports = (baseConfig, env) => {
const config = genDefaultConfig(baseConfig, env)
function resolve(dir) {
return path.join(__dirname, ‘..’, dir)
}
config.resolve = {
extensions: [‘.js’, ‘.vue’, ‘.json’],
alias: {