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ではじめるWeb Components
Search
hitsuji-haneta
September 06, 2019
Programming
590
1
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
VueではじめるWeb Components
hitsuji-haneta
September 06, 2019
More Decks by hitsuji-haneta
See All by hitsuji-haneta
SSIで覗き見るPWAの世界 / SSI on PWA
hitsuji_haneta
2
1.2k
GoとMicroserviceでDDDやってみました
hitsuji_haneta
0
420
やってみたよVueNative
hitsuji_haneta
2
510
これもフロントエンド!画面つきスピーカーで遊んでみた
hitsuji_haneta
0
120
webエンジニア向けブロックチェーンの技術的「へぇ」 / Blockchain tech tips for web developers
hitsuji_haneta
0
170
Other Decks in Programming
See All in Programming
Vibes Containers 〜AIで変わるコンテナ設計と運用〜
tkikuc
3
510
AI Agent時代のリアーキテクチャ戦略と実践
hokaccha
2
740
FastAPI の並行処理モデルを完全に理解する
hoto17296
9
3.8k
Intent as Code
shoppingjaws
2
350
AI駆動開発にグラフDBを重ねてみた
satoshi256kbyte
2
760
The Good Stuff, Not the Slop: Engineering High-Quality Android Apps with Modern AI Tooling
danybony
1
200
高専キャリア LT 発表内容
crysta1221
6
5.6k
Building an Out-of-Order CPU
latte72
1
720
Snowflakeで業務アプリを作ろう。 Snowflakeのアプリ機能解説&実践ガイド
ayumu_yamaguchi
1
150
新卒PdEのリアル
ryu1013
1
430
市販E-Readerを乗っ取れ 〜Embedded Swiftで電子ペーパーガジェットを制御する〜
trickart
0
120
Go を使い始めて 2 ヶ月の学び / My first two months with Go
contour_gara
0
420
Featured
See All Featured
Scaling GitHub
holman
464
140k
Become a Pro
speakerdeck
PRO
31
6.2k
Design in an AI World
tapps
1
310
Designing for humans not robots
tammielis
254
26k
[RailsConf 2023] Rails as a piece of cake
palkan
59
7k
Navigating Weather and Climate Data
rabernat
0
510
The Cult of Friendly URLs
andyhume
79
7k
Why Mistakes Are the Best Teachers: Turning Failure into a Pathway for Growth
auna
0
260
実際に使うSQLの書き方 徹底解説 / pgcon21j-tutorial
soudai
PRO
202
76k
The Art of Delivering Value - GDevCon NA Keynote
reverentgeek
16
2.2k
How to Get Subject Matter Experts Bought In and Actively Contributing to SEO & PR Initiatives.
livdayseo
0
190
Agile Actions for Facilitating Distributed Teams - ADO2019
mkilby
0
280
Transcript
Vue Web components ではじめる
自己紹介 高橋翔太 hitsuji-haneta thinkShake製作所 代表 LasTrust株式会社 CTO h1tsuj1_haneta
突然ですが皆さん
ってご存知ですか?? Web components
ライブラリなしで HTMLコンポーネント をカスタムできる ブラウザでサポート
Custom Elements Shadow DOM HTML Template
例 const template = document.createElement('template'); template.innerHTML = ` <style>…</style> <div>…</div>
`; class Button extends HTMLElement { constructor() { … this.$button .addEventListener('click', () => { console.log(this.message); }); } … } window .customElements .define(‘my-button', Button); my-button.js <script type=“module" src=“./my-button.js”> </script> <div> <h1>hello</h1> <my-button label=“hello” message=“world"> </my-button> </div> hoge.html
動かしてみると
vueの勉強会 なんですけど?
૬ੑൈ܈ʂ
メリット MyButton
メリット MyButton どんなフレームワークでも 使えちゃう
なぜ調べたか? BCライブラリ群 UI シンプルに使いたい…
<template> <div id="app"> <my-button label="hello" message=“world"/> </div> </template> <script> import
‘./components/my-button’; export default { ... }; </script> <style> ... </style> hoge.vue
ͪΐʔ؆୯
$ vue-cli-service build --target wc —-name my- button ./MyButton.vue <script
src=“https://unpkg.com/vue"></script> <script type=“module src=“./dist/my-button.js”> </script> <div> <h1>hello</h1> <my-button label=“hello” message=“world"> </my-button> </div> hoge.html
Vue Web components で はじめてみませんか?
ありがとうございました