2018-04-01から1ヶ月間の記事一覧

vueで遊ぶ 第2回 〜vue-router

インストール yarn add vue-router main.jsを書き換える import Vue from 'vue' import VueRouter from 'vue-router' import FoodList from './components/FoodList/FoodList' import EditFood from './components/EditFood/EditFood' import App from './Ap…

firebaseでサーバレス 第4回 〜firestoreへのinsert

html <label>名前</label><input v-model="name"/><br/> <label>タンパク質</label><input v-model="protein"/><br/> <label>脂質</label><input v-model="lipid"/><br/> <label>炭水化物</label><input v-model="carbo"/><br/> <button v-stream:click="plus$">登録</button> typescript const db = firebase.firestore() const foodsPms …</br/></br/></br/></br/>

firebaseでサーバレス 第3回 〜Webからのfirestore検索とリスト表示

vue-rxとrxjsのインストール yarn add vue-rx rxjs htmlの編集 <table> <thead> <tr> <th>名前</th> <th>タンパク質</th> <th>脂質</th> <th>炭水化物</th> </tr> </thead> <tbody> <tr v-for="(row, index) in foods" :key="index"> <td>{{ row["名前"] }}</td> <td>{{ row["タンパク質"] }}</td> <td>{{ row["脂質"] }}</td> <td>{{ row["炭水化物"] }}</td> </tr></tbody></table>

firebaseでサーバレス 第2回 〜Webからのfirestore検索

frontendプロジェクト配下で下記のコマンドを実行しfirebaseをインストール yarn add firebase とりあえずfirestoreのfoods配下のアクセス権限を与える service cloud.firestore { match /databases/{database}/documents { match /foods/{food} { allow rea…

firebaseでサーバレス 第1回 〜プロジェクト作成

vueでフロントエンドを軽く作りたいため、 サーバーサイドはfirebaseにすべておまかせしようと思う firebaseのプロジェクト作成 トップページ https://firebase.google.com/?hl=ja プロジェクトの追加 ウェブアプリにFirebaseを追加、でスクリプトタグを取得…

vueで遊ぶ 第1回 〜プロジェクト作成

SPAをやりたくて今流行のvueで始めてみました。 vue cliのインストール yarn global add @vue/cli projectの作成 vue create ngiy-frontend manualを選択 Typescriptを選択 In package.jsonを選択 Use Yarnを選択 projectの起動 cd ngiy-frontend yarn serve…

モナドトランスフォーマー (1)

ListとList[Option]とOptionの共存 val intList: List[Int] = List(1, 2, 3, 5) val strOptList: List[Option[String]] = List(Some("a"), Some("c"), None, Some("d")) val option: Option[Int] = Option(1) val t: OptionT[List, (Int, String, Int)] = fo…