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
이 함수, 실패하면 어떻게 되나요? null부터 Rich Errors까지, Kotlin 에러 처리 15년
haeti2
0
140
LoopHub - ローカルで動く GitHub で、AI と共同開発
jugyo
0
440
Go を使い始めて 2 ヶ月の学び / My first two months with Go
contour_gara
0
420
Hello, Hiroshima Geospatial Data! — Exploring DoboX with Python
ra0kley
0
170
型解析で実現する Go の言語内 DSL / Conference に Go! タイムテーブルの歩き方 for Gophers
mazrean
0
130
新卒PdEのリアル
ryu1013
1
410
週末にAI-DLCを本気で回したら$1,600溶けた
hbashimizu
0
130
20260828_品質と開発生産性を両立させる、AI時代のE2Eテストの考え方
magicpod
0
160
Seeing Through Serverless: Observability for AWS Lambda with ADOT and CloudWatch Application Signals
seike460
PRO
1
120
ソフトウェアラスタライザ
fadis
1
790
まだ間に合う!今年の夏こそSchemeのマクロ展開器を完全理解!
omasanori
0
630
信頼性の目標を誰も求めてない
shubox
0
490
Featured
See All Featured
Bootstrapping a Software Product
garrettdimon
PRO
306
120k
Amusing Abliteration
ianozsvald
1
290
Sharpening the Axe: The Primacy of Toolmaking
bcantrill
46
3k
XXLCSS - How to scale CSS and keep your sanity
sugarenia
249
1.3M
The MySQL Ecosystem @ GitHub 2015
samlambert
251
13k
[Rails World 2023 - Day 1 Closing Keynote] - The Magic of Rails
eileencodes
38
3k
How to Build an AI Search Optimization Roadmap - Criteria and Steps to Take #SEOIRL
aleyda
1
2.2k
What the history of the web can teach us about the future of AI
inesmontani
PRO
1
680
Tell your own story through comics
letsgokoyo
1
1.1k
sira's awesome portfolio website redesign presentation
elsirapls
0
400
Rails Girls Zürich Keynote
gr2m
96
14k
ReactJS: Keep Simple. Everything can be a component!
pedronauck
666
130k
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 で はじめてみませんか?
ありがとうございました