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
8
1.8k
Vue.js Single File Components++
meguro.es x gotanda.js #1
kazupon
April 28, 2017
Tweet
Share
More Decks by kazupon
See All by kazupon
Nitro v3
kazupon
2
260
わたしのOSS活動
kazupon
3
540
Vapor Revolution
kazupon
3
3.8k
Vue.js最新動向
kazupon
3
1.6k
Vue 3.4
kazupon
13
4.7k
Vue & Vite Rustify
kazupon
4
2.4k
Vue.jsエコシステム動向2023
kazupon
17
8k
Reactivity Transform
kazupon
1
1.4k
わたしのOSS活動
kazupon
1
1k
Other Decks in Programming
See All in Programming
CloudflareのSandbox SDKを試してみた
syumai
0
130
Kotlin 2.2が切り拓く: コンテキストパラメータで書く関数型DSLと新しい依存管理のかたち
knih
0
400
Making Angular Apps Smarter with Generative AI: Local and Offline-capable
christianliebel
PRO
0
110
Tangible Code
chobishiba
3
520
AI時代に必須!状況言語化スキル / ai-context-verbalization
minodriven
3
380
Blazing Fast UI Development with Compose Hot Reload (Bangladesh KUG, October 2025)
zsmb
2
500
PHPライセンス変更の議論を通じて学ぶOSSライセンスの基礎
matsuo_atsushi
0
140
知られているようで知られていない JavaScriptの仕様 4選
syumai
0
460
「10分以内に機能を消せる状態」 の実現のためにやっていること
togishima
1
270
Core MIDI を勉強して作曲用の電子ピアノ作ってみた!
hypebeans
0
100
Bakuraku E2E Scenario Test System Architecture #bakuraku_qa_study
teyamagu
PRO
0
680
Dive into Triton Internals
appleparan
0
480
Featured
See All Featured
We Have a Design System, Now What?
morganepeng
54
7.9k
Put a Button on it: Removing Barriers to Going Fast.
kastner
60
4.1k
A designer walks into a library…
pauljervisheath
210
24k
Save Time (by Creating Custom Rails Generators)
garrettdimon
PRO
33
1.8k
How to Think Like a Performance Engineer
csswizardry
28
2.3k
[Rails World 2023 - Day 1 Closing Keynote] - The Magic of Rails
eileencodes
37
2.6k
10 Git Anti Patterns You Should be Aware of
lemiorhan
PRO
658
61k
The Language of Interfaces
destraynor
162
25k
BBQ
matthewcrist
89
9.9k
The Invisible Side of Design
smashingmag
302
51k
How To Stay Up To Date on Web Technology
chriscoyier
791
250k
Build The Right Thing And Hit Your Dates
maggiecrowley
38
2.9k
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!