Submit Search
Upload
ガス単独診断に学ぶ Vue js
•
0 likes
•
980 views
Tomoya Kawanishi
Follow
Introduce use-case for VueJS in Enechange Gas simulation.
Read less
Read more
Technology
Report
Share
Report
Share
1 of 16
Download now
Download to read offline
Recommended
Introduction of Azure Database for MySQL / PostgreSQL
Introduction of Azure Database for MySQL / PostgreSQL
Kuniteru Asami
Tips for passing AZ-103 once
Tips for passing AZ-103 once
Oshitari_kochi
20150513 wbsユーザ会資料-大山
20150513 wbsユーザ会資料-大山
Ohyama Hiroyasu
//Build 2021 FASTER 紹介
//Build 2021 FASTER 紹介
Takekazu Omi
Bicep 入門 MySQL編
Bicep 入門 MySQL編
Takekazu Omi
OSC関西@京都2014 CloudStackの歩き方
OSC関西@京都2014 CloudStackの歩き方
Midori Oge
Understanding Azure Application Gateway
Understanding Azure Application Gateway
Kuniteru Asami
aws_opsworks
aws_opsworks
Yukihiko SAWANOBORI
Recommended
Introduction of Azure Database for MySQL / PostgreSQL
Introduction of Azure Database for MySQL / PostgreSQL
Kuniteru Asami
Tips for passing AZ-103 once
Tips for passing AZ-103 once
Oshitari_kochi
20150513 wbsユーザ会資料-大山
20150513 wbsユーザ会資料-大山
Ohyama Hiroyasu
//Build 2021 FASTER 紹介
//Build 2021 FASTER 紹介
Takekazu Omi
Bicep 入門 MySQL編
Bicep 入門 MySQL編
Takekazu Omi
OSC関西@京都2014 CloudStackの歩き方
OSC関西@京都2014 CloudStackの歩き方
Midori Oge
Understanding Azure Application Gateway
Understanding Azure Application Gateway
Kuniteru Asami
aws_opsworks
aws_opsworks
Yukihiko SAWANOBORI
Openstackサテライトプロジェクトまとめ
Openstackサテライトプロジェクトまとめ
Takahiro Shida
20131116_OSC福岡_CloudOS「Apache CloudStack」概要
20131116_OSC福岡_CloudOS「Apache CloudStack」概要
Midori Oge
20130914_OSC北海道_CloudStack一問一答!
20130914_OSC北海道_CloudStack一問一答!
Midori Oge
ApacheCloudstack4.1最新情報ver2
ApacheCloudstack4.1最新情報ver2
Midori Oge
Open Source Study Session #3
Open Source Study Session #3
Satoshi Konno
Physical Web導入の話
Physical Web導入の話
KatsuyaENDOH
Riot.jsを用いたweb開発 takusuta tech conf #1
Riot.jsを用いたweb開発 takusuta tech conf #1
Keisuke Imai
Azure Kubernetes Service の「学び方」
Azure Kubernetes Service の「学び方」
Lisa Imai
Node.jsとAWS入門(Elastic Beanstalk & AWS SDK for Node.js)
Node.jsとAWS入門(Elastic Beanstalk & AWS SDK for Node.js)
崇之 清水
20201216 jazug azureexam
20201216 jazug azureexam
TomoakiOno
Azure Application Insights + Angular5+ - Global azure boot camp 2019@sapporo LT
Azure Application Insights + Angular5+ - Global azure boot camp 2019@sapporo LT
Jun-ichi Sakamoto
Introduction to WildFly Swarm
Introduction to WildFly Swarm
Yoshimasa Tanabe
日本仮想化技術 OpenStackサービスメニューのご紹介
日本仮想化技術 OpenStackサービスメニューのご紹介
VirtualTech Japan Inc.
20140726 jaws-ug chiba AWS operation best practice
20140726 jaws-ug chiba AWS operation best practice
Kazuki Ueki
How to face the Kubernetes ?
How to face the Kubernetes ?
Yoshio Terada
AWSを用いてNode-REDでらくらくAPI
AWSを用いてNode-REDでらくらくAPI
Kazumi Kanda
Ansible の CI を drone/Dokcker で試してみた
Ansible の CI を drone/Dokcker で試してみた
Kenta Nishimura
最近Preview公開されたAzure テストサービスを試してみた
最近Preview公開されたAzure テストサービスを試してみた
Hiroyuki Mori
OpenStack最新動向 2016/2
OpenStack最新動向 2016/2
Akira Yoshiyama
Invitation to the Open Cloud Campus #osckansai 2011
Invitation to the Open Cloud Campus #osckansai 2011
Masahito Zembutsu
英単語の覚え方
英単語の覚え方
Tomoya Kawanishi
ENECHANGE社での Scout APM 利用事例
ENECHANGE社での Scout APM 利用事例
Tomoya Kawanishi
More Related Content
What's hot
Openstackサテライトプロジェクトまとめ
Openstackサテライトプロジェクトまとめ
Takahiro Shida
20131116_OSC福岡_CloudOS「Apache CloudStack」概要
20131116_OSC福岡_CloudOS「Apache CloudStack」概要
Midori Oge
20130914_OSC北海道_CloudStack一問一答!
20130914_OSC北海道_CloudStack一問一答!
Midori Oge
ApacheCloudstack4.1最新情報ver2
ApacheCloudstack4.1最新情報ver2
Midori Oge
Open Source Study Session #3
Open Source Study Session #3
Satoshi Konno
Physical Web導入の話
Physical Web導入の話
KatsuyaENDOH
Riot.jsを用いたweb開発 takusuta tech conf #1
Riot.jsを用いたweb開発 takusuta tech conf #1
Keisuke Imai
Azure Kubernetes Service の「学び方」
Azure Kubernetes Service の「学び方」
Lisa Imai
Node.jsとAWS入門(Elastic Beanstalk & AWS SDK for Node.js)
Node.jsとAWS入門(Elastic Beanstalk & AWS SDK for Node.js)
崇之 清水
20201216 jazug azureexam
20201216 jazug azureexam
TomoakiOno
Azure Application Insights + Angular5+ - Global azure boot camp 2019@sapporo LT
Azure Application Insights + Angular5+ - Global azure boot camp 2019@sapporo LT
Jun-ichi Sakamoto
Introduction to WildFly Swarm
Introduction to WildFly Swarm
Yoshimasa Tanabe
日本仮想化技術 OpenStackサービスメニューのご紹介
日本仮想化技術 OpenStackサービスメニューのご紹介
VirtualTech Japan Inc.
20140726 jaws-ug chiba AWS operation best practice
20140726 jaws-ug chiba AWS operation best practice
Kazuki Ueki
How to face the Kubernetes ?
How to face the Kubernetes ?
Yoshio Terada
AWSを用いてNode-REDでらくらくAPI
AWSを用いてNode-REDでらくらくAPI
Kazumi Kanda
Ansible の CI を drone/Dokcker で試してみた
Ansible の CI を drone/Dokcker で試してみた
Kenta Nishimura
最近Preview公開されたAzure テストサービスを試してみた
最近Preview公開されたAzure テストサービスを試してみた
Hiroyuki Mori
OpenStack最新動向 2016/2
OpenStack最新動向 2016/2
Akira Yoshiyama
Invitation to the Open Cloud Campus #osckansai 2011
Invitation to the Open Cloud Campus #osckansai 2011
Masahito Zembutsu
What's hot
(20)
Openstackサテライトプロジェクトまとめ
Openstackサテライトプロジェクトまとめ
20131116_OSC福岡_CloudOS「Apache CloudStack」概要
20131116_OSC福岡_CloudOS「Apache CloudStack」概要
20130914_OSC北海道_CloudStack一問一答!
20130914_OSC北海道_CloudStack一問一答!
ApacheCloudstack4.1最新情報ver2
ApacheCloudstack4.1最新情報ver2
Open Source Study Session #3
Open Source Study Session #3
Physical Web導入の話
Physical Web導入の話
Riot.jsを用いたweb開発 takusuta tech conf #1
Riot.jsを用いたweb開発 takusuta tech conf #1
Azure Kubernetes Service の「学び方」
Azure Kubernetes Service の「学び方」
Node.jsとAWS入門(Elastic Beanstalk & AWS SDK for Node.js)
Node.jsとAWS入門(Elastic Beanstalk & AWS SDK for Node.js)
20201216 jazug azureexam
20201216 jazug azureexam
Azure Application Insights + Angular5+ - Global azure boot camp 2019@sapporo LT
Azure Application Insights + Angular5+ - Global azure boot camp 2019@sapporo LT
Introduction to WildFly Swarm
Introduction to WildFly Swarm
日本仮想化技術 OpenStackサービスメニューのご紹介
日本仮想化技術 OpenStackサービスメニューのご紹介
20140726 jaws-ug chiba AWS operation best practice
20140726 jaws-ug chiba AWS operation best practice
How to face the Kubernetes ?
How to face the Kubernetes ?
AWSを用いてNode-REDでらくらくAPI
AWSを用いてNode-REDでらくらくAPI
Ansible の CI を drone/Dokcker で試してみた
Ansible の CI を drone/Dokcker で試してみた
最近Preview公開されたAzure テストサービスを試してみた
最近Preview公開されたAzure テストサービスを試してみた
OpenStack最新動向 2016/2
OpenStack最新動向 2016/2
Invitation to the Open Cloud Campus #osckansai 2011
Invitation to the Open Cloud Campus #osckansai 2011
More from Tomoya Kawanishi
英単語の覚え方
英単語の覚え方
Tomoya Kawanishi
ENECHANGE社での Scout APM 利用事例
ENECHANGE社での Scout APM 利用事例
Tomoya Kawanishi
エンジニア転職のノウハウ
エンジニア転職のノウハウ
Tomoya Kawanishi
Ruby の文字列について
Ruby の文字列について
Tomoya Kawanishi
Ruby on Rails のキャッシュ機構について
Ruby on Rails のキャッシュ機構について
Tomoya Kawanishi
Ruby初心者からよく質問されること
Ruby初心者からよく質問されること
Tomoya Kawanishi
RubyGems と Bundler について
RubyGems と Bundler について
Tomoya Kawanishi
Ruby の正規表現について
Ruby の正規表現について
Tomoya Kawanishi
Ruby での外部コマンドの実行について
Ruby での外部コマンドの実行について
Tomoya Kawanishi
Ruby のワンライナーについて
Ruby のワンライナーについて
Tomoya Kawanishi
AWS のコスト管理をちゃんとしたくてやったこと
AWS のコスト管理をちゃんとしたくてやったこと
Tomoya Kawanishi
PostgreSQL のイケてるテクニック7選
PostgreSQL のイケてるテクニック7選
Tomoya Kawanishi
HTTPと Webクローリングについて
HTTPと Webクローリングについて
Tomoya Kawanishi
Rake
Rake
Tomoya Kawanishi
Active record query interface
Active record query interface
Tomoya Kawanishi
Active Support のコア拡張機能について
Active Support のコア拡張機能について
Tomoya Kawanishi
Ruby ビジネス創出展 Ruby初心者向けプログラミングセミナー
Ruby ビジネス創出展 Ruby初心者向けプログラミングセミナー
Tomoya Kawanishi
RubyのDir、File、IO について
RubyのDir、File、IO について
Tomoya Kawanishi
Thread の利用事例紹介
Thread の利用事例紹介
Tomoya Kawanishi
Ruby の制御構造とリテラルについて
Ruby の制御構造とリテラルについて
Tomoya Kawanishi
More from Tomoya Kawanishi
(20)
英単語の覚え方
英単語の覚え方
ENECHANGE社での Scout APM 利用事例
ENECHANGE社での Scout APM 利用事例
エンジニア転職のノウハウ
エンジニア転職のノウハウ
Ruby の文字列について
Ruby の文字列について
Ruby on Rails のキャッシュ機構について
Ruby on Rails のキャッシュ機構について
Ruby初心者からよく質問されること
Ruby初心者からよく質問されること
RubyGems と Bundler について
RubyGems と Bundler について
Ruby の正規表現について
Ruby の正規表現について
Ruby での外部コマンドの実行について
Ruby での外部コマンドの実行について
Ruby のワンライナーについて
Ruby のワンライナーについて
AWS のコスト管理をちゃんとしたくてやったこと
AWS のコスト管理をちゃんとしたくてやったこと
PostgreSQL のイケてるテクニック7選
PostgreSQL のイケてるテクニック7選
HTTPと Webクローリングについて
HTTPと Webクローリングについて
Rake
Rake
Active record query interface
Active record query interface
Active Support のコア拡張機能について
Active Support のコア拡張機能について
Ruby ビジネス創出展 Ruby初心者向けプログラミングセミナー
Ruby ビジネス創出展 Ruby初心者向けプログラミングセミナー
RubyのDir、File、IO について
RubyのDir、File、IO について
Thread の利用事例紹介
Thread の利用事例紹介
Ruby の制御構造とリテラルについて
Ruby の制御構造とリテラルについて
Recently uploaded
【早稲田AI研究会 講義資料】3DスキャンとTextTo3Dのツールを知ろう!(Vol.1)
【早稲田AI研究会 講義資料】3DスキャンとTextTo3Dのツールを知ろう!(Vol.1)
Hiroki Ichikura
Open Source UN-Conference 2024 Kawagoe - 独自OS「DaisyOS GB」の紹介
Open Source UN-Conference 2024 Kawagoe - 独自OS「DaisyOS GB」の紹介
Yuma Ohgami
スマートフォンを用いた新生児あやし動作の教示システム
スマートフォンを用いた新生児あやし動作の教示システム
sugiuralab
論文紹介:Content-Aware Token Sharing for Efficient Semantic Segmentation With Vis...
論文紹介:Content-Aware Token Sharing for Efficient Semantic Segmentation With Vis...
Toru Tamaki
論文紹介:Semantic segmentation using Vision Transformers: A survey
論文紹介:Semantic segmentation using Vision Transformers: A survey
Toru Tamaki
[DevOpsDays Tokyo 2024] 〜デジタルとアナログのはざまに〜 スマートビルディング爆速開発を支える 自動化テスト戦略
[DevOpsDays Tokyo 2024] 〜デジタルとアナログのはざまに〜 スマートビルディング爆速開発を支える 自動化テスト戦略
Ryo Sasaki
SOPを理解する 2024/04/19 の勉強会で発表されたものです
SOPを理解する 2024/04/19 の勉強会で発表されたものです
iPride Co., Ltd.
論文紹介:Automated Classification of Model Errors on ImageNet
論文紹介:Automated Classification of Model Errors on ImageNet
Toru Tamaki
TSAL operation mechanism and circuit diagram.pdf
TSAL operation mechanism and circuit diagram.pdf
taisei2219
Postman LT Fukuoka_Quick Prototype_By Daniel
Postman LT Fukuoka_Quick Prototype_By Daniel
danielhu54
Recently uploaded
(10)
【早稲田AI研究会 講義資料】3DスキャンとTextTo3Dのツールを知ろう!(Vol.1)
【早稲田AI研究会 講義資料】3DスキャンとTextTo3Dのツールを知ろう!(Vol.1)
Open Source UN-Conference 2024 Kawagoe - 独自OS「DaisyOS GB」の紹介
Open Source UN-Conference 2024 Kawagoe - 独自OS「DaisyOS GB」の紹介
スマートフォンを用いた新生児あやし動作の教示システム
スマートフォンを用いた新生児あやし動作の教示システム
論文紹介:Content-Aware Token Sharing for Efficient Semantic Segmentation With Vis...
論文紹介:Content-Aware Token Sharing for Efficient Semantic Segmentation With Vis...
論文紹介:Semantic segmentation using Vision Transformers: A survey
論文紹介:Semantic segmentation using Vision Transformers: A survey
[DevOpsDays Tokyo 2024] 〜デジタルとアナログのはざまに〜 スマートビルディング爆速開発を支える 自動化テスト戦略
[DevOpsDays Tokyo 2024] 〜デジタルとアナログのはざまに〜 スマートビルディング爆速開発を支える 自動化テスト戦略
SOPを理解する 2024/04/19 の勉強会で発表されたものです
SOPを理解する 2024/04/19 の勉強会で発表されたものです
論文紹介:Automated Classification of Model Errors on ImageNet
論文紹介:Automated Classification of Model Errors on ImageNet
TSAL operation mechanism and circuit diagram.pdf
TSAL operation mechanism and circuit diagram.pdf
Postman LT Fukuoka_Quick Prototype_By Daniel
Postman LT Fukuoka_Quick Prototype_By Daniel
ガス単独診断に学ぶ Vue js
1.
ガス単独診断に学ぶ VueJS 2017/11/28 Tomoya Kawanishi
2.
Otemachi.rb #1 発表資料
「ガス単独診断に学ぶ VueJS」 1自己紹介 川西 智也 エネチェンジ株式会社 チーフエンジニア Ruby関西代表 出自 新卒で入社したのは、関西電力 もともとはサーバサイド、インフラまわりを主に担当 最近はフロントエンドも開発するようになった Buzzった記事 Ruby のオススメの機能 7選 https://qiita.com/cuzic/items/a265f140fdff289d5c07 PostgreSQL のパフォーマンスチューニング https://qiita.com/cuzic/items/f9b846e6171a54079d77
3.
Otemachi.rb #1 発表資料
「ガス単独診断に学ぶ VueJS」 ガス単独診断とは 従来、電気・ガスの組合せで最適な会社を提案 電気はすでに切替済のユーザも多い ガスだけの組合せでの節約額の提示のニーズあり ガス単独診断をリリース! 初期版はチャットUIだった ただし、分岐もなく一直線で聞きたいことを聞くだけ チャットUIの意味なし VueJS を使った SPA に全面リニューアル! ユーザ利便性を向上! 2
4.
Otemachi.rb #1 発表資料
「ガス単独診断に学ぶ VueJS」 ガス単独診断(リニューアル後) 3 https://enechange.jp/gas
5.
Otemachi.rb #1 発表資料
「ガス単独診断に学ぶ VueJS」 computed プロパティを多用! computed プロパティはかなり便利! たとえ、1行の内容でも computed プロパティにする 読みやすく簡潔になる 結果がキャッシュされるので、高速化の効果もある 4 computed: { postcodeFull(){ return this.postcode1 + this.postcode2; }, isPostcodeValid(){ return this.postcodeFull.match(/^¥d{7}$/); }, isPostcodeErrorVisible(){ return this.tainted["postcode1"] && this.tainted["postcode2"] && !this.isPostcodeValid; }, … 郵便番号のエラー表示での使用例
6.
Otemachi.rb #1 発表資料
「ガス単独診断に学ぶ VueJS」 compted プロパティを watch ! VueJS では computed プロパティを watch できる 条件分岐をシンプルにできる 5 watch: { isPostcodeValid(current){ if(current){ this.getGasProviders(); this.resetSimulation(); } }, … 郵便番号入力後の処理での使用例
7.
Otemachi.rb #1 発表資料
「ガス単独診断に学ぶ VueJS」 $refs の活用 $refs で、特定の DOM 要素を参照可能 ここでは、郵便番号1を入力後、フォーカスを移動する ために $refs を使っている 6 watch: { isPostcode1Valid(current, old){ if(current){ this.$refs.postcode2.focus(); } }, … }, computed: { isPostcode1Valid(){ return this.postcode1.length === 3; }, <input type="text" … name="postcode2" v-model="postcode2" … ref="postcode2"> 郵便番号での $refs の使用例
8.
Otemachi.rb #1 発表資料
「ガス単独診断に学ぶ VueJS」 入力エラーのリアルタイム表示 1 / 2 7 <div … v-show="isPostcodeErrorVisible"><span> 郵便番号を入力してください</span></div> computed: { isPostcodeErrorVisible(){ return this.tainted["postcode1"] && this.tainted["postcode2"] && !this.isPostcodeValid; }, 入力誤りがあったとき、エラー文言を表示したい 最初から、エラー文言が表示されてるとウザい 入力後だけ、 エラー表示を 有効化 tainted という プロパティに 触ったか どうかを格納
9.
Otemachi.rb #1 発表資料
「ガス単独診断に学ぶ VueJS」 入力エラーのリアルタイム表示 2 / 2 @blur は v-on:blur の syntax sugar blur イベントをフックして、特定の処理を実行できる this.$set(this.tainted, fieldname, true); は this.tainted[fieldname] = true と同じ意味 $set を使うと computed 等の再計算が実行される 8 methods: { doTaint(event){ if(event.target.value){ const fieldname = event.target.name; this.$set(this.tainted, fieldname, true); } } … <input type="text" … name="postcode2" v-model="postcode2" … @blur="doTaint" ref="postcode2"> エラー表示での @blur イベントの使用例
10.
Otemachi.rb #1 発表資料
「ガス単独診断に学ぶ VueJS」 結果は1行ごとに v-component として設計 Vueコンポーネントをどう分割するか? 設計結果 入力: 1つの Vue コンポーネント 結果: 1行(1つのガスプラン)ごとにコンポーネント化 computed プロパティの機能を活用し、 View 側をシンプルに、見通しよく記述 9 <ul class="m__plans-container"> <li v-for="result in results"> <% if is_pc? %> <plans-finder-item-pc :result="result" /> <% else %> <plans-finder-item-smp :result="result" /> <% end %> </li> </ul> 結果ごとに Vue コンポーネントでレンダリング
11.
Otemachi.rb #1 発表資料
「ガス単独診断に学ぶ VueJS」 x-template の活用 10 <script type="text/x-template" id="plans-finder-item-pc"> <%= render 'plans_finder_item_pc' %> </script> <script type="text/x-template" id="plans-finder-item-smp"> <%= render 'plans_finder_item_smp' %> </script> 結果画面のマークアップをどう記述するか? x-template を使って、そのまま従来の View を活用 .vue などは逆に活用せず Ruby on Rails の従来の View と同じ運用の方が、 トータルで分かりやすいと判断した 従来の Rails プロジェクトで開発していた人にとっての とっつきやすさを重視 x-template の活用の例
12.
Otemachi.rb #1 発表資料
「ガス単独診断に学ぶ VueJS」 Spread演算子を使った共通化 ES2015 の Spread 演算子を使って、オブジェクトリテ ラルの一部を共通的に利用 相違点は、ID だけ。 すっきり! 11 const plansFinderItemPc = { template: "#plans-finder-item-pc", ...plansFinderItemCommon }; const plansFinderItemSmp = { template: "#plans-finder-item-smp", ...plansFinderItemCommon }; Vue.component('plans-finder-item-pc', plansFinderItemPc); Vue.component('plans-finder-item-smp', plansFinderItemSmp); モバイルと PC で、共通の設定を利用する例
13.
Otemachi.rb #1 発表資料
「ガス単独診断に学ぶ VueJS」 Filter の活用 一部の処理は View 側で頻出する(例: カンマ区切り) メソッド呼び出しは、読みにくい 右から左に進むと思考が止まる Filter を活用! 左から右に進む!読みやすい! 12 filters: { numberWithDelimiter(value){ return value.toString().replace(/¥B(?=(¥d{3})+(?!¥d))/g, ","); }, abs(value){ return Math.abs(Number(value)); } <span class="value">{{ actualYearSaving | abs | numberWithDelimiter }}</span><span class="unit">円</span><span v- if="isCheaper">節約</span> <span v-else>割高</span> Filter の活用例
14.
Otemachi.rb #1 発表資料
「ガス単独診断に学ぶ VueJS」 番外編 lodash の活用 Lodash はすごく便利だった。オススメ _.debounce _.differenceBy _.each _.find _.filter _.isEmpty _.map _.reject _.some _.sortBy 13
15.
Otemachi.rb #1 発表資料
「ガス単独診断に学ぶ VueJS」 14ガス単独診断全面リニューアルの感想 VueJS を活用して、全面リニューアルを実施した 2週間で全面リニューアルが完了でき、 VueJS の開発生産性の高さを実感した 特に computed プロパティが非常に便利だった View 側のコードをシンプルにできた
16.
15 ご清聴ありがとう ございました
Download now