Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Vue.js Single File Components++
Search
kazupon
April 28, 2017
Programming
1.8k
8
Share
Vue.js Single File Components++
meguro.es x gotanda.js #1
kazupon
April 28, 2017
More Decks by kazupon
See All by kazupon
プラグインで拡張される Context をtype-safe にする難しさと設計判断
kazupon
2
470
Oxlint JS plugins
kazupon
1
1.3k
gunshi
kazupon
1
220
Nitro v3
kazupon
2
540
わたしのOSS活動
kazupon
3
620
Vapor Revolution
kazupon
3
4.2k
Vue.js最新動向
kazupon
3
1.6k
Vue 3.4
kazupon
13
4.9k
Vue & Vite Rustify
kazupon
4
2.5k
Other Decks in Programming
See All in Programming
横断組織出身のQAEがインプロセスQAEでつまずいたこと・活かせたこと
ty89
0
470
AI駆動開発で崩れていくコードベースを立て直す
kyoko_nr_nr
1
400
色即是空、空即是色、データサイエンス
kamoneggi
1
210
AIチームを指揮するOSS「TAKT」活用術 / How to Use “TAKT,” an OSS Tool for Orchestrating AI Teams
nrslib
6
750
1人1案件のプロダクトエンジニア時代に、"プロセス監督"としてチャレンジしたこと
non0113
0
350
inferと仲良くなる10分間
ryokatsuse
1
280
Make SRE Operations Easier with Azure SRE Agent
kkamegawa
0
2k
ユニットテストの先へ:テスト技法で要求・仕様を整理するJava開発実践 / Beyond_Unit_Testing_Practical_Java_Development_Techniques_for_Organizing_Requirements_and_Specifications
shimashima35
0
310
次世代リンターで探る、tsgo 時代における型認識カスタムルールの現実解
ytakahashii
3
1.3k
Inspired By RubyKaigi (EN)
atzzcokek
0
440
自動レビューエンジンの実装と運用 ~レビューのない世界へ~
kurukuru1999
2
300
SPMマルチモジュールで テストカバレッジを取得する技法
yosshi4486
0
130
Featured
See All Featured
Practical Orchestrator
shlominoach
191
11k
Building a Scalable Design System with Sketch
lauravandoore
463
34k
The Limits of Empathy - UXLibs8
cassininazir
1
340
Visual Storytelling: How to be a Superhuman Communicator
reverentgeek
2
540
StorybookのUI Testing Handbookを読んだ
zakiyama
31
6.8k
Exploring anti-patterns in Rails
aemeredith
3
380
Test your architecture with Archunit
thirion
1
2.3k
Leveraging Curiosity to Care for An Aging Population
cassininazir
1
250
WENDY [Excerpt]
tessaabrams
11
38k
Visualizing Your Data: Incorporating Mongo into Loggly Infrastructure
mongodb
49
10k
Designing for Performance
lara
611
70k
Marketing Yourself as an Engineer | Alaka | Gurzu
gurzu
0
210
Transcript
Vue.js Single File Components++ Meguro.es x Gontanda.js #1 2017-04-28 @kazupon
Who are you ?
Vue.js Core Team member https://github.com/kazupon
Introduction
• All in one file Single File Components .vue <HTML>
{CSS} ({JS}) Scoped CSS CSS Modules ES2015 in template
• Alternative language implementation Single File Components .vue
Single File Components • Include from HTML/CSS/JS Files .vue <HTML>
{CSS} ({JS})
Provide official some tools .vue vue-loader rollup-plugin-vue vueify bundling bundling
({JS})
So, Very useful!
Released new feature !! • In vue-loader v10.2, it was
published https://github.com/vuejs/vue-loader/commit/7d3e005d56781e8e5e4ae8f90212f782e4b3a509
And from v11.3 later • It become available used in
components! https://github.com/vuejs/vue-loader/commit/11cec30eb3925a144e1d484357b13c501d5fb3f9
Exciting feature!!
Custom Blocks
What’s Custom Blocks ? • Block of Single File Components
that defined with User. <blog> - - - title - - - bla bla bla … bla bla bla … </blog>
Custom Blocks Use cases • Documentation • Localization • Unit
Testing • Example playground • … etc
Documentation .vue .vue .vue .md vue-loader extract
Localization .vue ⚙ plugin vue-loader bundling ({JS}) hello run
Unit Testing .vue vue-loader bundling ({JS}) ✅ test1 : OK
✅ test2 : OK ❌ test3 : NG run
Example Playground .vue vue-loader bundling ({JS}) run playground runtime ⚙
Custom Blocks Real World
Localization with vue-i18n https://kazupon.github.io/vue-i18n/en/sfc.html message: hello world !!
Blog with ream (example) http://unvue-custom-block.surge.sh
vue-play (be planning) https://github.com/vue-play/vue-play/issues/5
DEMO
How to use
configure webpack conf
Available in Components • you need a custom loader
configure custom loader
Reference • vue-loader documentation https://vue-loader.vuejs.org
Conclusion
Conclusion • You can extend the single file components with
custom blocks • Depending on your idea, you can make your single file components even more useful !
One more thing …
Vue.js community for Japanese • You can join via Vue.js
official site http://jp.vuejs.org
genba.fm #1 • 2017/05 GW later, speak about Vue.js https://genba.fm
Thanks!