SlideShare uma empresa Scribd logo
1 de 31
Baixar para ler offline
Copyright  (C) 2021 Toranoana Inc. All Rights Reserved.
Vue3でアプリ開発してみて
困ったこと4選
虎の穴ラボ 古賀
1
Copyright  (C) 2021 Toranoana Inc. All Rights Reserved.
対象の人
● 日頃、Nuxt.jsやVue2(Vue-CLI/Webpack)で開発している
人
● Composition API初心者の人
● TypeScriptをあまり触ったことがない人
2
Copyright  (C) 2021 Toranoana Inc. All Rights Reserved.
アジェンダ
1. @を使ってインポートができない
2. SVG画像の色を変えたい(Vite)
3. ロジックの共通化をしたい
4. コンポーネント連携のemitが動かない
5. まとめ
3
Copyright  (C) 2021 Toranoana Inc. All Rights Reserved.
1. @を使ってインポートができない
Nuxt.jsの様に、いつもどおりに書きました
4
この場合、@が解決できずエラーになりま
す
Copyright  (C) 2021 Toranoana Inc. All Rights Reserved.
1. @を使ってインポートができない
ViteとTypeScriptのalias設定を追加します
5
tsconfig.jsonにpathsの設定を追加 vite.config.tsにaliasの設定を追加
※ これと同等の設定はvue-cli(webpack)でも必要です
Copyright  (C) 2021 Toranoana Inc. All Rights Reserved.
Nuxt.jsが良い感じにしてる部
分はVue3にはない
6
日頃、Nuxt.jsを使ってて無意識でした 😱
Copyright  (C) 2021 Toranoana Inc. All Rights Reserved.
2. SVG画像の色を変えたい
srcフォルダに置いた、SVGファイルを読み込もうとしましたが、、、
7
読み込まれない・・・!!
Chromeの開発者ツールで確認すると
これでは、読み込まれない
Copyright  (C) 2021 Toranoana Inc. All Rights Reserved.
2. SVG画像の色を変えたい
実際のソースコード(NGパターン1)
8
imgのsrcにsvgのファイルパスを書く
Copyright  (C) 2021 Toranoana Inc. All Rights Reserved.
実際のソースコード(NGパターン2)
2. SVG画像の色を変えたい
9
svgのファイルをインポートする
インポートしたSVGをsrc属性にバインドする
Copyright  (C) 2021 Toranoana Inc. All Rights Reserved.
そういえば、vue-svg-loader
が必要だった😱
10
Copyright  (C) 2021 Toranoana Inc. All Rights Reserved.
vue-svg-loader を見るとVite
に非対応っぽい
😱
11
Copyright  (C) 2021 Toranoana Inc. All Rights Reserved.
そうだ、vite-svg-loader を使おう!
2. SVG画像の色を変えたい
12
SVGをインポートする
(TypeScript の場合、?componet を付ける)
Copyright  (C) 2021 Toranoana Inc. All Rights Reserved.
vite-svg-loader を使おう!
2. SVG画像の色を変えたい
13
SVGをコンポーネントとして記載する
SVGが表示された!!
Copyright  (C) 2021 Toranoana Inc. All Rights Reserved.
vite-svg-loader を使おう!
2. SVG画像の色を変えたい
14
SVGのコンポーネントにclassを記載する
SVGの色が変わった!!
Copyright  (C) 2021 Toranoana Inc. All Rights Reserved.
Viteの場合は
vite-svg-loaderを使おう!!
15
Viteでビルドする場合は、 vue-cli(webpack)ではない!
Copyright  (C) 2021 Toranoana Inc. All Rights Reserved.
3. ロジックの共通化をしたい
firebase functionsのエミュレータの初期化処理を共通化したい!
16
すべてのfunction呼び出しにこの処理
を書いていた・・・!!
Copyright  (C) 2021 Toranoana Inc. All Rights Reserved.
3. ロジックの共通化をしたい
Vue2で、mixin/pluginを使ってたので代替手段を探しましたが、、、
見当たらず😱
mixin は Composition API で非推奨らしい
(どこの記事で見たか忘れました
🙏)
17
Copyright  (C) 2021 Toranoana Inc. All Rights Reserved.
3. ロジックの共通化をしたい
この件を、とらラボの朝活チャンネルで相談したところ
18
Composition APIなら
mixinする必要あんまりないのでは。
たしかにそうかも。。。
Copyright  (C) 2021 Toranoana Inc. All Rights Reserved.
3. ロジックの共通化をしたい
アドバイスを元に普通にtsファイルをimportするようにしました
19
共通関数を記載した、 tsファ
イルをインポート
共通関数を呼び出しする
Copyright  (C) 2021 Toranoana Inc. All Rights Reserved.
3. ロジックの共通化をしたい
作成したtsファイル
20
作成した、共通関数
Copyright  (C) 2021 Toranoana Inc. All Rights Reserved.
Vue3でロジックを共通化した
い場合はimportしよう!!
21
Composition APIの場合
Copyright  (C) 2021 Toranoana Inc. All Rights Reserved.
4. コンポーネント連携のemitが動かない
ボタンをクリックしたら、”click”をemitする!
22
Vue2/Nuxt.jsの様に、いつもどおりに書き
ました
Copyright  (C) 2021 Toranoana Inc. All Rights Reserved.
4. コンポーネント連携のemitが動かない
うごかない。。。。
ボタンを押しても、clickイベントが発火しない😱
公式サイトを見ながら、調べてみました💪
23
Copyright  (C) 2021 Toranoana Inc. All Rights Reserved.
4. コンポーネント連携のemitが動かない
原因1:exportにemitsにイベント名を書いてない
emitsを書いてない
24
Composition APIで必要になった
Copyright  (C) 2021 Toranoana Inc. All Rights Reserved.
4. コンポーネント連携のemitが動かない
原因2:emitを宣言してない
25
Composition APIでは、this.$emitではなく
なった
Copyright  (C) 2021 Toranoana Inc. All Rights Reserved.
原因3:event.targetは常にHTMLButtonElementではない
4. コンポーネント連携のemitが動かない
26
emitを実行する分岐に入らない
※ Buttonタグ内のsvgの部分をクリックすると、 svgタグに
なる
Copyright  (C) 2021 Toranoana Inc. All Rights Reserved.
修正後
4. コンポーネント連携のemitが動かない
27
原因1〜3を修正した後😆
Copyright  (C) 2021 Toranoana Inc. All Rights Reserved.
困ったら、公式ドキュメントをみよ
う!
28
Vueは日本語のドキュメントが整備されてるので助かる!
Copyright  (C) 2021 Toranoana Inc. All Rights Reserved.
まとめ!
29
Vue3でサービスを作ってみた感想 🙌
Copyright  (C) 2021 Toranoana Inc. All Rights Reserved.
7. まとめ
Vue3はVue2/Nuxt.jsの知識がそこそこ活かせる。
困ったら、
1. Vue3の公式サイト(日本語)
2. StackOverflow(英語の方)
3. vuejs/vue-next(英語)のIssueを探す
(開発する前に、テックカンファレンスの藤原さんの登壇資料を読むとすんなり入れます)
(情報量が少ないので、困ったら公式。新しいフレームワークあるある。)
30
Copyright  (C) 2021 Toranoana Inc. All Rights Reserved.
ご静聴、ありがとうございました
31

Mais conteúdo relacionado

Mais procurados

ネットワーク ゲームにおけるTCPとUDPの使い分け
ネットワーク ゲームにおけるTCPとUDPの使い分けネットワーク ゲームにおけるTCPとUDPの使い分け
ネットワーク ゲームにおけるTCPとUDPの使い分けモノビット エンジン
 
はじめようVue3!とらのあなラボのフロントエンドを学ぶ(藤原)
はじめようVue3!とらのあなラボのフロントエンドを学ぶ(藤原)はじめようVue3!とらのあなラボのフロントエンドを学ぶ(藤原)
はじめようVue3!とらのあなラボのフロントエンドを学ぶ(藤原)虎の穴 開発室
 
Akkaとは。アクターモデル とは。
Akkaとは。アクターモデル とは。Akkaとは。アクターモデル とは。
Akkaとは。アクターモデル とは。Kenjiro Kubota
 
REALITY低遅延モード配信を支えるリアルタイムサーバとデータパイプライン
REALITY低遅延モード配信を支えるリアルタイムサーバとデータパイプラインREALITY低遅延モード配信を支えるリアルタイムサーバとデータパイプライン
REALITY低遅延モード配信を支えるリアルタイムサーバとデータパイプラインgree_tech
 
【Unite Tokyo 2019】今すぐ現場で覚えておきたい最適化技法 ~「ゲシュタルト・オーディン」開発における最適化事例~
【Unite Tokyo 2019】今すぐ現場で覚えておきたい最適化技法 ~「ゲシュタルト・オーディン」開発における最適化事例~【Unite Tokyo 2019】今すぐ現場で覚えておきたい最適化技法 ~「ゲシュタルト・オーディン」開発における最適化事例~
【Unite Tokyo 2019】今すぐ現場で覚えておきたい最適化技法 ~「ゲシュタルト・オーディン」開発における最適化事例~UnityTechnologiesJapan002
 
Guide to GraalVM (JJUG CCC 2019 Fall)
Guide to GraalVM (JJUG CCC 2019 Fall)Guide to GraalVM (JJUG CCC 2019 Fall)
Guide to GraalVM (JJUG CCC 2019 Fall)Koichi Sakata
 
こわくない Git
こわくない Gitこわくない Git
こわくない GitKota Saito
 
【Unite Tokyo 2018】その最適化、本当に最適ですか!? ~正しい最適化を行うためのテクニック~
【Unite Tokyo 2018】その最適化、本当に最適ですか!? ~正しい最適化を行うためのテクニック~【Unite Tokyo 2018】その最適化、本当に最適ですか!? ~正しい最適化を行うためのテクニック~
【Unite Tokyo 2018】その最適化、本当に最適ですか!? ~正しい最適化を行うためのテクニック~Unity Technologies Japan K.K.
 
CEDEC2019 大規模モバイルゲーム運用におけるマスタデータ管理事例
CEDEC2019 大規模モバイルゲーム運用におけるマスタデータ管理事例CEDEC2019 大規模モバイルゲーム運用におけるマスタデータ管理事例
CEDEC2019 大規模モバイルゲーム運用におけるマスタデータ管理事例sairoutine
 
Multibranch pipelineでいろいろ学んだこと
Multibranch pipelineでいろいろ学んだことMultibranch pipelineでいろいろ学んだこと
Multibranch pipelineでいろいろ学んだことRecruit Lifestyle Co., Ltd.
 
Unityによるリアルタイム通信とMagicOnionによるC#大統一理論の実現
Unityによるリアルタイム通信とMagicOnionによるC#大統一理論の実現Unityによるリアルタイム通信とMagicOnionによるC#大統一理論の実現
Unityによるリアルタイム通信とMagicOnionによるC#大統一理論の実現Yoshifumi Kawai
 
Jenkinsfileのlintで救える命がある
Jenkinsfileのlintで救える命があるJenkinsfileのlintで救える命がある
Jenkinsfileのlintで救える命があるJumpei Miyata
 
NVIDIA GPUで作るHeadless X11 Linux
NVIDIA GPUで作るHeadless X11 LinuxNVIDIA GPUで作るHeadless X11 Linux
NVIDIA GPUで作るHeadless X11 LinuxTomoki SHISHIKURA
 
3種類のTEE比較(Intel SGX, ARM TrustZone, RISC-V Keystone)
3種類のTEE比較(Intel SGX, ARM TrustZone, RISC-V Keystone)3種類のTEE比較(Intel SGX, ARM TrustZone, RISC-V Keystone)
3種類のTEE比較(Intel SGX, ARM TrustZone, RISC-V Keystone)Kuniyasu Suzaki
 
Kubernetesによる機械学習基盤への挑戦
Kubernetesによる機械学習基盤への挑戦Kubernetesによる機械学習基盤への挑戦
Kubernetesによる機械学習基盤への挑戦Preferred Networks
 
Javaのログ出力: 道具と考え方
Javaのログ出力: 道具と考え方Javaのログ出力: 道具と考え方
Javaのログ出力: 道具と考え方Taku Miyakawa
 
ChatGPTは思ったほど賢くない
ChatGPTは思ったほど賢くないChatGPTは思ったほど賢くない
ChatGPTは思ったほど賢くないCarnot Inc.
 
今話題のいろいろなコンテナランタイムを比較してみた
今話題のいろいろなコンテナランタイムを比較してみた今話題のいろいろなコンテナランタイムを比較してみた
今話題のいろいろなコンテナランタイムを比較してみたKohei Tokunaga
 

Mais procurados (20)

ネットワーク ゲームにおけるTCPとUDPの使い分け
ネットワーク ゲームにおけるTCPとUDPの使い分けネットワーク ゲームにおけるTCPとUDPの使い分け
ネットワーク ゲームにおけるTCPとUDPの使い分け
 
はじめようVue3!とらのあなラボのフロントエンドを学ぶ(藤原)
はじめようVue3!とらのあなラボのフロントエンドを学ぶ(藤原)はじめようVue3!とらのあなラボのフロントエンドを学ぶ(藤原)
はじめようVue3!とらのあなラボのフロントエンドを学ぶ(藤原)
 
Akkaとは。アクターモデル とは。
Akkaとは。アクターモデル とは。Akkaとは。アクターモデル とは。
Akkaとは。アクターモデル とは。
 
REALITY低遅延モード配信を支えるリアルタイムサーバとデータパイプライン
REALITY低遅延モード配信を支えるリアルタイムサーバとデータパイプラインREALITY低遅延モード配信を支えるリアルタイムサーバとデータパイプライン
REALITY低遅延モード配信を支えるリアルタイムサーバとデータパイプライン
 
【Unite Tokyo 2019】今すぐ現場で覚えておきたい最適化技法 ~「ゲシュタルト・オーディン」開発における最適化事例~
【Unite Tokyo 2019】今すぐ現場で覚えておきたい最適化技法 ~「ゲシュタルト・オーディン」開発における最適化事例~【Unite Tokyo 2019】今すぐ現場で覚えておきたい最適化技法 ~「ゲシュタルト・オーディン」開発における最適化事例~
【Unite Tokyo 2019】今すぐ現場で覚えておきたい最適化技法 ~「ゲシュタルト・オーディン」開発における最適化事例~
 
Guide to GraalVM (JJUG CCC 2019 Fall)
Guide to GraalVM (JJUG CCC 2019 Fall)Guide to GraalVM (JJUG CCC 2019 Fall)
Guide to GraalVM (JJUG CCC 2019 Fall)
 
こわくない Git
こわくない Gitこわくない Git
こわくない Git
 
【Unite Tokyo 2018】その最適化、本当に最適ですか!? ~正しい最適化を行うためのテクニック~
【Unite Tokyo 2018】その最適化、本当に最適ですか!? ~正しい最適化を行うためのテクニック~【Unite Tokyo 2018】その最適化、本当に最適ですか!? ~正しい最適化を行うためのテクニック~
【Unite Tokyo 2018】その最適化、本当に最適ですか!? ~正しい最適化を行うためのテクニック~
 
CEDEC2019 大規模モバイルゲーム運用におけるマスタデータ管理事例
CEDEC2019 大規模モバイルゲーム運用におけるマスタデータ管理事例CEDEC2019 大規模モバイルゲーム運用におけるマスタデータ管理事例
CEDEC2019 大規模モバイルゲーム運用におけるマスタデータ管理事例
 
Multibranch pipelineでいろいろ学んだこと
Multibranch pipelineでいろいろ学んだことMultibranch pipelineでいろいろ学んだこと
Multibranch pipelineでいろいろ学んだこと
 
Unityによるリアルタイム通信とMagicOnionによるC#大統一理論の実現
Unityによるリアルタイム通信とMagicOnionによるC#大統一理論の実現Unityによるリアルタイム通信とMagicOnionによるC#大統一理論の実現
Unityによるリアルタイム通信とMagicOnionによるC#大統一理論の実現
 
Jenkinsfileのlintで救える命がある
Jenkinsfileのlintで救える命があるJenkinsfileのlintで救える命がある
Jenkinsfileのlintで救える命がある
 
Unityと.NET
Unityと.NETUnityと.NET
Unityと.NET
 
レシピの作り方入門
レシピの作り方入門レシピの作り方入門
レシピの作り方入門
 
NVIDIA GPUで作るHeadless X11 Linux
NVIDIA GPUで作るHeadless X11 LinuxNVIDIA GPUで作るHeadless X11 Linux
NVIDIA GPUで作るHeadless X11 Linux
 
3種類のTEE比較(Intel SGX, ARM TrustZone, RISC-V Keystone)
3種類のTEE比較(Intel SGX, ARM TrustZone, RISC-V Keystone)3種類のTEE比較(Intel SGX, ARM TrustZone, RISC-V Keystone)
3種類のTEE比較(Intel SGX, ARM TrustZone, RISC-V Keystone)
 
Kubernetesによる機械学習基盤への挑戦
Kubernetesによる機械学習基盤への挑戦Kubernetesによる機械学習基盤への挑戦
Kubernetesによる機械学習基盤への挑戦
 
Javaのログ出力: 道具と考え方
Javaのログ出力: 道具と考え方Javaのログ出力: 道具と考え方
Javaのログ出力: 道具と考え方
 
ChatGPTは思ったほど賢くない
ChatGPTは思ったほど賢くないChatGPTは思ったほど賢くない
ChatGPTは思ったほど賢くない
 
今話題のいろいろなコンテナランタイムを比較してみた
今話題のいろいろなコンテナランタイムを比較してみた今話題のいろいろなコンテナランタイムを比較してみた
今話題のいろいろなコンテナランタイムを比較してみた
 

Semelhante a Vue3でアプリ開発してみて 困ったこと4選

20210809 story book_driven_new_system_development_nuxtjs
20210809 story book_driven_new_system_development_nuxtjs20210809 story book_driven_new_system_development_nuxtjs
20210809 story book_driven_new_system_development_nuxtjs虎の穴 開発室
 
Fargateを使いこなす!creatiaのインフラを支える技術について
Fargateを使いこなす!creatiaのインフラを支える技術についてFargateを使いこなす!creatiaのインフラを支える技術について
Fargateを使いこなす!creatiaのインフラを支える技術について虎の穴 開発室
 
GitOps Core Concepts & Ways of Structuring Your Repos
GitOps Core Concepts & Ways of Structuring Your ReposGitOps Core Concepts & Ways of Structuring Your Repos
GitOps Core Concepts & Ways of Structuring Your ReposWeaveworks
 
Panther loves Symfony apps
Panther loves Symfony appsPanther loves Symfony apps
Panther loves Symfony appsSimone D'Amico
 
From Mediasoup WebRTC to Livekit Self-Hosted .pdf
From Mediasoup WebRTC to  Livekit Self-Hosted .pdfFrom Mediasoup WebRTC to  Livekit Self-Hosted .pdf
From Mediasoup WebRTC to Livekit Self-Hosted .pdfatyenoria
 
Kamaelia Europython Tutorial
Kamaelia Europython TutorialKamaelia Europython Tutorial
Kamaelia Europython Tutorialkamaelian
 
Understanding and building Your Own Docker
Understanding and building Your Own DockerUnderstanding and building Your Own Docker
Understanding and building Your Own DockerMotiejus Jakštys
 
What every C++ programmer should know about modern compilers (w/ comments, AC...
What every C++ programmer should know about modern compilers (w/ comments, AC...What every C++ programmer should know about modern compilers (w/ comments, AC...
What every C++ programmer should know about modern compilers (w/ comments, AC...Sławomir Zborowski
 
From Ant to Rake
From Ant to RakeFrom Ant to Rake
From Ant to Rakejazzman1980
 
Whats resources compat_contextcompat_and_appcompat
Whats resources compat_contextcompat_and_appcompatWhats resources compat_contextcompat_and_appcompat
Whats resources compat_contextcompat_and_appcompatChang John
 
Concurrency and Parallelism with Scala
Concurrency and Parallelism with ScalaConcurrency and Parallelism with Scala
Concurrency and Parallelism with ScalaTimothy Perrett
 
The Nightmare Fuzzing Suite and Blind Code Coverage Fuzzer
The Nightmare Fuzzing Suite and Blind Code Coverage FuzzerThe Nightmare Fuzzing Suite and Blind Code Coverage Fuzzer
The Nightmare Fuzzing Suite and Blind Code Coverage FuzzerJoxean Koret
 
Are 64-bit errors real?
Are  64-bit errors real?Are  64-bit errors real?
Are 64-bit errors real?PVS-Studio
 
Symfony on steroids
: Vue.js, Mercure, Panther
Symfony on steroids
: Vue.js, Mercure, PantherSymfony on steroids
: Vue.js, Mercure, Panther
Symfony on steroids
: Vue.js, Mercure, PantherLes-Tilleuls.coop
 
"Generating Types without climbing a tree", Matteo Collina
"Generating Types without climbing a tree", Matteo Collina "Generating Types without climbing a tree", Matteo Collina
"Generating Types without climbing a tree", Matteo Collina Fwdays
 
React Conf 17 Recap
React Conf 17 RecapReact Conf 17 Recap
React Conf 17 RecapAlex Babkov
 
Progressively enhance your Symfony 4 app using Vue, API Platform, Mercure and...
Progressively enhance your Symfony 4 app using Vue, API Platform, Mercure and...Progressively enhance your Symfony 4 app using Vue, API Platform, Mercure and...
Progressively enhance your Symfony 4 app using Vue, API Platform, Mercure and...Les-Tilleuls.coop
 

Semelhante a Vue3でアプリ開発してみて 困ったこと4選 (20)

20210809 story book_driven_new_system_development_nuxtjs
20210809 story book_driven_new_system_development_nuxtjs20210809 story book_driven_new_system_development_nuxtjs
20210809 story book_driven_new_system_development_nuxtjs
 
Fargateを使いこなす!creatiaのインフラを支える技術について
Fargateを使いこなす!creatiaのインフラを支える技術についてFargateを使いこなす!creatiaのインフラを支える技術について
Fargateを使いこなす!creatiaのインフラを支える技術について
 
GitOps Core Concepts & Ways of Structuring Your Repos
GitOps Core Concepts & Ways of Structuring Your ReposGitOps Core Concepts & Ways of Structuring Your Repos
GitOps Core Concepts & Ways of Structuring Your Repos
 
Panther loves Symfony apps
Panther loves Symfony appsPanther loves Symfony apps
Panther loves Symfony apps
 
Ionic debugger
Ionic debuggerIonic debugger
Ionic debugger
 
From Mediasoup WebRTC to Livekit Self-Hosted .pdf
From Mediasoup WebRTC to  Livekit Self-Hosted .pdfFrom Mediasoup WebRTC to  Livekit Self-Hosted .pdf
From Mediasoup WebRTC to Livekit Self-Hosted .pdf
 
Kamaelia Europython Tutorial
Kamaelia Europython TutorialKamaelia Europython Tutorial
Kamaelia Europython Tutorial
 
Understanding and building Your Own Docker
Understanding and building Your Own DockerUnderstanding and building Your Own Docker
Understanding and building Your Own Docker
 
What every C++ programmer should know about modern compilers (w/ comments, AC...
What every C++ programmer should know about modern compilers (w/ comments, AC...What every C++ programmer should know about modern compilers (w/ comments, AC...
What every C++ programmer should know about modern compilers (w/ comments, AC...
 
Web Hooks
Web HooksWeb Hooks
Web Hooks
 
Concurrency in ruby
Concurrency in rubyConcurrency in ruby
Concurrency in ruby
 
From Ant to Rake
From Ant to RakeFrom Ant to Rake
From Ant to Rake
 
Whats resources compat_contextcompat_and_appcompat
Whats resources compat_contextcompat_and_appcompatWhats resources compat_contextcompat_and_appcompat
Whats resources compat_contextcompat_and_appcompat
 
Concurrency and Parallelism with Scala
Concurrency and Parallelism with ScalaConcurrency and Parallelism with Scala
Concurrency and Parallelism with Scala
 
The Nightmare Fuzzing Suite and Blind Code Coverage Fuzzer
The Nightmare Fuzzing Suite and Blind Code Coverage FuzzerThe Nightmare Fuzzing Suite and Blind Code Coverage Fuzzer
The Nightmare Fuzzing Suite and Blind Code Coverage Fuzzer
 
Are 64-bit errors real?
Are  64-bit errors real?Are  64-bit errors real?
Are 64-bit errors real?
 
Symfony on steroids
: Vue.js, Mercure, Panther
Symfony on steroids
: Vue.js, Mercure, PantherSymfony on steroids
: Vue.js, Mercure, Panther
Symfony on steroids
: Vue.js, Mercure, Panther
 
"Generating Types without climbing a tree", Matteo Collina
"Generating Types without climbing a tree", Matteo Collina "Generating Types without climbing a tree", Matteo Collina
"Generating Types without climbing a tree", Matteo Collina
 
React Conf 17 Recap
React Conf 17 RecapReact Conf 17 Recap
React Conf 17 Recap
 
Progressively enhance your Symfony 4 app using Vue, API Platform, Mercure and...
Progressively enhance your Symfony 4 app using Vue, API Platform, Mercure and...Progressively enhance your Symfony 4 app using Vue, API Platform, Mercure and...
Progressively enhance your Symfony 4 app using Vue, API Platform, Mercure and...
 

Mais de 虎の穴 開発室

Railsのデバッグ どうやるかを改めて確認する
Railsのデバッグ どうやるかを改めて確認するRailsのデバッグ どうやるかを改めて確認する
Railsのデバッグ どうやるかを改めて確認する虎の穴 開発室
 
虎の穴ラボ エンジニア採用説明資料 .pdf
虎の穴ラボ エンジニア採用説明資料 .pdf虎の穴ラボ エンジニア採用説明資料 .pdf
虎の穴ラボ エンジニア採用説明資料 .pdf虎の穴 開発室
 
Deno Deployと組み合わせるのに Upstashをおすすめしたい.pdf
Deno Deployと組み合わせるのに Upstashをおすすめしたい.pdfDeno Deployと組み合わせるのに Upstashをおすすめしたい.pdf
Deno Deployと組み合わせるのに Upstashをおすすめしたい.pdf虎の穴 開発室
 
toranoana.deno #6 アジェンダ 採用説明
toranoana.deno #6 アジェンダ 採用説明toranoana.deno #6 アジェンダ 採用説明
toranoana.deno #6 アジェンダ 採用説明虎の穴 開発室
 
Deno 向け WEB 開発用のツールを作ったので 紹介します
Deno 向け WEB 開発用のツールを作ったので 紹介しますDeno 向け WEB 開発用のツールを作ったので 紹介します
Deno 向け WEB 開発用のツールを作ったので 紹介します虎の穴 開発室
 
Supabase Edge Functions と Netlify Edge Functions を使ってみる – 機能とその比較 –
Supabase Edge Functions と Netlify Edge Functions を使ってみる – 機能とその比較 –Supabase Edge Functions と Netlify Edge Functions を使ってみる – 機能とその比較 –
Supabase Edge Functions と Netlify Edge Functions を使ってみる – 機能とその比較 –虎の穴 開発室
 
【エンジニアの勉強法ハックLT- vol.7】ゲームから学んだ勉強のこと
【エンジニアの勉強法ハックLT- vol.7】ゲームから学んだ勉強のこと【エンジニアの勉強法ハックLT- vol.7】ゲームから学んだ勉強のこと
【エンジニアの勉強法ハックLT- vol.7】ゲームから学んだ勉強のこと虎の穴 開発室
 
通販開発部の西田さん「通販開発マネジメントの5ルール」
通販開発部の西田さん「通販開発マネジメントの5ルール」通販開発部の西田さん「通販開発マネジメントの5ルール」
通販開発部の西田さん「通販開発マネジメントの5ルール」虎の穴 開発室
 
社内DX推進!非エンジニア向けにプログラミング講座を実施してみた!
社内DX推進!非エンジニア向けにプログラミング講座を実施してみた!社内DX推進!非エンジニア向けにプログラミング講座を実施してみた!
社内DX推進!非エンジニア向けにプログラミング講座を実施してみた!虎の穴 開発室
 
セキュリティを強化しよう!CloudArmorの機能解説
セキュリティを強化しよう!CloudArmorの機能解説セキュリティを強化しよう!CloudArmorの機能解説
セキュリティを強化しよう!CloudArmorの機能解説虎の穴 開発室
 
JavaScript LT会 〜 React.js Node.js歓迎 〜 Deno で やってみるweb開発
JavaScript LT会 〜 React.js   Node.js歓迎 〜 Deno で やってみるweb開発JavaScript LT会 〜 React.js   Node.js歓迎 〜 Deno で やってみるweb開発
JavaScript LT会 〜 React.js Node.js歓迎 〜 Deno で やってみるweb開発虎の穴 開発室
 
Amplify Studioを使ってみた
Amplify Studioを使ってみたAmplify Studioを使ってみた
Amplify Studioを使ってみた虎の穴 開発室
 
いいテスト会 (スプリントレビュー) をやろう!
いいテスト会 (スプリントレビュー) をやろう!いいテスト会 (スプリントレビュー) をやろう!
いいテスト会 (スプリントレビュー) をやろう!虎の穴 開発室
 
【Saitama.js】Denoのすすめ
【Saitama.js】Denoのすすめ【Saitama.js】Denoのすすめ
【Saitama.js】Denoのすすめ虎の穴 開発室
 
虎の穴ラボ Tech day#3 チームで戦う!とらのあな通販冬の大感謝祭でのフロント開発について
虎の穴ラボ Tech day#3 チームで戦う!とらのあな通販冬の大感謝祭でのフロント開発について虎の穴ラボ Tech day#3 チームで戦う!とらのあな通販冬の大感謝祭でのフロント開発について
虎の穴ラボ Tech day#3 チームで戦う!とらのあな通販冬の大感謝祭でのフロント開発について虎の穴 開発室
 
【とらのあなラボ Tech Day #3】新規システムにおける技術選定〜GoとgRPCを採用した話〜
【とらのあなラボ Tech Day #3】新規システムにおける技術選定〜GoとgRPCを採用した話〜	【とらのあなラボ Tech Day #3】新規システムにおける技術選定〜GoとgRPCを採用した話〜
【とらのあなラボ Tech Day #3】新規システムにおける技術選定〜GoとgRPCを採用した話〜 虎の穴 開発室
 
虎の穴ラボ TechDay#3 フルリモート率100%!リモートワークを可能にするマネージメント
虎の穴ラボ TechDay#3 フルリモート率100%!リモートワークを可能にするマネージメント 虎の穴ラボ TechDay#3 フルリモート率100%!リモートワークを可能にするマネージメント
虎の穴ラボ TechDay#3 フルリモート率100%!リモートワークを可能にするマネージメント 虎の穴 開発室
 

Mais de 虎の穴 開発室 (20)

FizzBuzzで学ぶJavaの進化
FizzBuzzで学ぶJavaの進化FizzBuzzで学ぶJavaの進化
FizzBuzzで学ぶJavaの進化
 
Railsのデバッグ どうやるかを改めて確認する
Railsのデバッグ どうやるかを改めて確認するRailsのデバッグ どうやるかを改めて確認する
Railsのデバッグ どうやるかを改めて確認する
 
虎の穴ラボ エンジニア採用説明資料 .pdf
虎の穴ラボ エンジニア採用説明資料 .pdf虎の穴ラボ エンジニア採用説明資料 .pdf
虎の穴ラボ エンジニア採用説明資料 .pdf
 
Deno Deployと組み合わせるのに Upstashをおすすめしたい.pdf
Deno Deployと組み合わせるのに Upstashをおすすめしたい.pdfDeno Deployと組み合わせるのに Upstashをおすすめしたい.pdf
Deno Deployと組み合わせるのに Upstashをおすすめしたい.pdf
 
toranoana.deno #6 アジェンダ 採用説明
toranoana.deno #6 アジェンダ 採用説明toranoana.deno #6 アジェンダ 採用説明
toranoana.deno #6 アジェンダ 採用説明
 
Deno 向け WEB 開発用のツールを作ったので 紹介します
Deno 向け WEB 開発用のツールを作ったので 紹介しますDeno 向け WEB 開発用のツールを作ったので 紹介します
Deno 向け WEB 開発用のツールを作ったので 紹介します
 
Supabase Edge Functions と Netlify Edge Functions を使ってみる – 機能とその比較 –
Supabase Edge Functions と Netlify Edge Functions を使ってみる – 機能とその比較 –Supabase Edge Functions と Netlify Edge Functions を使ってみる – 機能とその比較 –
Supabase Edge Functions と Netlify Edge Functions を使ってみる – 機能とその比較 –
 
GCPの画像認識APIの紹介
GCPの画像認識APIの紹介 GCPの画像認識APIの紹介
GCPの画像認識APIの紹介
 
【エンジニアの勉強法ハックLT- vol.7】ゲームから学んだ勉強のこと
【エンジニアの勉強法ハックLT- vol.7】ゲームから学んだ勉強のこと【エンジニアの勉強法ハックLT- vol.7】ゲームから学んだ勉強のこと
【エンジニアの勉強法ハックLT- vol.7】ゲームから学んだ勉強のこと
 
GitHub APIとfreshで遊ぼう
GitHub APIとfreshで遊ぼうGitHub APIとfreshで遊ぼう
GitHub APIとfreshで遊ぼう
 
通販開発部の西田さん「通販開発マネジメントの5ルール」
通販開発部の西田さん「通販開発マネジメントの5ルール」通販開発部の西田さん「通販開発マネジメントの5ルール」
通販開発部の西田さん「通販開発マネジメントの5ルール」
 
社内DX推進!非エンジニア向けにプログラミング講座を実施してみた!
社内DX推進!非エンジニア向けにプログラミング講座を実施してみた!社内DX推進!非エンジニア向けにプログラミング講座を実施してみた!
社内DX推進!非エンジニア向けにプログラミング講座を実施してみた!
 
セキュリティを強化しよう!CloudArmorの機能解説
セキュリティを強化しよう!CloudArmorの機能解説セキュリティを強化しよう!CloudArmorの機能解説
セキュリティを強化しよう!CloudArmorの機能解説
 
JavaScript LT会 〜 React.js Node.js歓迎 〜 Deno で やってみるweb開発
JavaScript LT会 〜 React.js   Node.js歓迎 〜 Deno で やってみるweb開発JavaScript LT会 〜 React.js   Node.js歓迎 〜 Deno で やってみるweb開発
JavaScript LT会 〜 React.js Node.js歓迎 〜 Deno で やってみるweb開発
 
Amplify Studioを使ってみた
Amplify Studioを使ってみたAmplify Studioを使ってみた
Amplify Studioを使ってみた
 
いいテスト会 (スプリントレビュー) をやろう!
いいテスト会 (スプリントレビュー) をやろう!いいテスト会 (スプリントレビュー) をやろう!
いいテスト会 (スプリントレビュー) をやろう!
 
【Saitama.js】Denoのすすめ
【Saitama.js】Denoのすすめ【Saitama.js】Denoのすすめ
【Saitama.js】Denoのすすめ
 
虎の穴ラボ Tech day#3 チームで戦う!とらのあな通販冬の大感謝祭でのフロント開発について
虎の穴ラボ Tech day#3 チームで戦う!とらのあな通販冬の大感謝祭でのフロント開発について虎の穴ラボ Tech day#3 チームで戦う!とらのあな通販冬の大感謝祭でのフロント開発について
虎の穴ラボ Tech day#3 チームで戦う!とらのあな通販冬の大感謝祭でのフロント開発について
 
【とらのあなラボ Tech Day #3】新規システムにおける技術選定〜GoとgRPCを採用した話〜
【とらのあなラボ Tech Day #3】新規システムにおける技術選定〜GoとgRPCを採用した話〜	【とらのあなラボ Tech Day #3】新規システムにおける技術選定〜GoとgRPCを採用した話〜
【とらのあなラボ Tech Day #3】新規システムにおける技術選定〜GoとgRPCを採用した話〜
 
虎の穴ラボ TechDay#3 フルリモート率100%!リモートワークを可能にするマネージメント
虎の穴ラボ TechDay#3 フルリモート率100%!リモートワークを可能にするマネージメント 虎の穴ラボ TechDay#3 フルリモート率100%!リモートワークを可能にするマネージメント
虎の穴ラボ TechDay#3 フルリモート率100%!リモートワークを可能にするマネージメント
 

Último

Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsJoaquim Jorge
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...Neo4j
 
HTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation StrategiesHTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation StrategiesBoston Institute of Analytics
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfsudhanshuwaghmare1
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processorsdebabhi2
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationRadu Cotescu
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...apidays
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...DianaGray10
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationSafe Software
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
Advantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessAdvantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessPixlogix Infotech
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)Gabriella Davis
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?Antenna Manufacturer Coco
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdflior mazor
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024The Digital Insurer
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Scriptwesley chun
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProduct Anonymous
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 

Último (20)

Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
HTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation StrategiesHTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation Strategies
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024
 
Advantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessAdvantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your Business
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdf
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 

Vue3でアプリ開発してみて 困ったこと4選

  • 1. Copyright  (C) 2021 Toranoana Inc. All Rights Reserved. Vue3でアプリ開発してみて 困ったこと4選 虎の穴ラボ 古賀 1
  • 2. Copyright  (C) 2021 Toranoana Inc. All Rights Reserved. 対象の人 ● 日頃、Nuxt.jsやVue2(Vue-CLI/Webpack)で開発している 人 ● Composition API初心者の人 ● TypeScriptをあまり触ったことがない人 2
  • 3. Copyright  (C) 2021 Toranoana Inc. All Rights Reserved. アジェンダ 1. @を使ってインポートができない 2. SVG画像の色を変えたい(Vite) 3. ロジックの共通化をしたい 4. コンポーネント連携のemitが動かない 5. まとめ 3
  • 4. Copyright  (C) 2021 Toranoana Inc. All Rights Reserved. 1. @を使ってインポートができない Nuxt.jsの様に、いつもどおりに書きました 4 この場合、@が解決できずエラーになりま す
  • 5. Copyright  (C) 2021 Toranoana Inc. All Rights Reserved. 1. @を使ってインポートができない ViteとTypeScriptのalias設定を追加します 5 tsconfig.jsonにpathsの設定を追加 vite.config.tsにaliasの設定を追加 ※ これと同等の設定はvue-cli(webpack)でも必要です
  • 6. Copyright  (C) 2021 Toranoana Inc. All Rights Reserved. Nuxt.jsが良い感じにしてる部 分はVue3にはない 6 日頃、Nuxt.jsを使ってて無意識でした 😱
  • 7. Copyright  (C) 2021 Toranoana Inc. All Rights Reserved. 2. SVG画像の色を変えたい srcフォルダに置いた、SVGファイルを読み込もうとしましたが、、、 7 読み込まれない・・・!! Chromeの開発者ツールで確認すると これでは、読み込まれない
  • 8. Copyright  (C) 2021 Toranoana Inc. All Rights Reserved. 2. SVG画像の色を変えたい 実際のソースコード(NGパターン1) 8 imgのsrcにsvgのファイルパスを書く
  • 9. Copyright  (C) 2021 Toranoana Inc. All Rights Reserved. 実際のソースコード(NGパターン2) 2. SVG画像の色を変えたい 9 svgのファイルをインポートする インポートしたSVGをsrc属性にバインドする
  • 10. Copyright  (C) 2021 Toranoana Inc. All Rights Reserved. そういえば、vue-svg-loader が必要だった😱 10
  • 11. Copyright  (C) 2021 Toranoana Inc. All Rights Reserved. vue-svg-loader を見るとVite に非対応っぽい 😱 11
  • 12. Copyright  (C) 2021 Toranoana Inc. All Rights Reserved. そうだ、vite-svg-loader を使おう! 2. SVG画像の色を変えたい 12 SVGをインポートする (TypeScript の場合、?componet を付ける)
  • 13. Copyright  (C) 2021 Toranoana Inc. All Rights Reserved. vite-svg-loader を使おう! 2. SVG画像の色を変えたい 13 SVGをコンポーネントとして記載する SVGが表示された!!
  • 14. Copyright  (C) 2021 Toranoana Inc. All Rights Reserved. vite-svg-loader を使おう! 2. SVG画像の色を変えたい 14 SVGのコンポーネントにclassを記載する SVGの色が変わった!!
  • 15. Copyright  (C) 2021 Toranoana Inc. All Rights Reserved. Viteの場合は vite-svg-loaderを使おう!! 15 Viteでビルドする場合は、 vue-cli(webpack)ではない!
  • 16. Copyright  (C) 2021 Toranoana Inc. All Rights Reserved. 3. ロジックの共通化をしたい firebase functionsのエミュレータの初期化処理を共通化したい! 16 すべてのfunction呼び出しにこの処理 を書いていた・・・!!
  • 17. Copyright  (C) 2021 Toranoana Inc. All Rights Reserved. 3. ロジックの共通化をしたい Vue2で、mixin/pluginを使ってたので代替手段を探しましたが、、、 見当たらず😱 mixin は Composition API で非推奨らしい (どこの記事で見たか忘れました 🙏) 17
  • 18. Copyright  (C) 2021 Toranoana Inc. All Rights Reserved. 3. ロジックの共通化をしたい この件を、とらラボの朝活チャンネルで相談したところ 18 Composition APIなら mixinする必要あんまりないのでは。 たしかにそうかも。。。
  • 19. Copyright  (C) 2021 Toranoana Inc. All Rights Reserved. 3. ロジックの共通化をしたい アドバイスを元に普通にtsファイルをimportするようにしました 19 共通関数を記載した、 tsファ イルをインポート 共通関数を呼び出しする
  • 20. Copyright  (C) 2021 Toranoana Inc. All Rights Reserved. 3. ロジックの共通化をしたい 作成したtsファイル 20 作成した、共通関数
  • 21. Copyright  (C) 2021 Toranoana Inc. All Rights Reserved. Vue3でロジックを共通化した い場合はimportしよう!! 21 Composition APIの場合
  • 22. Copyright  (C) 2021 Toranoana Inc. All Rights Reserved. 4. コンポーネント連携のemitが動かない ボタンをクリックしたら、”click”をemitする! 22 Vue2/Nuxt.jsの様に、いつもどおりに書き ました
  • 23. Copyright  (C) 2021 Toranoana Inc. All Rights Reserved. 4. コンポーネント連携のemitが動かない うごかない。。。。 ボタンを押しても、clickイベントが発火しない😱 公式サイトを見ながら、調べてみました💪 23
  • 24. Copyright  (C) 2021 Toranoana Inc. All Rights Reserved. 4. コンポーネント連携のemitが動かない 原因1:exportにemitsにイベント名を書いてない emitsを書いてない 24 Composition APIで必要になった
  • 25. Copyright  (C) 2021 Toranoana Inc. All Rights Reserved. 4. コンポーネント連携のemitが動かない 原因2:emitを宣言してない 25 Composition APIでは、this.$emitではなく なった
  • 26. Copyright  (C) 2021 Toranoana Inc. All Rights Reserved. 原因3:event.targetは常にHTMLButtonElementではない 4. コンポーネント連携のemitが動かない 26 emitを実行する分岐に入らない ※ Buttonタグ内のsvgの部分をクリックすると、 svgタグに なる
  • 27. Copyright  (C) 2021 Toranoana Inc. All Rights Reserved. 修正後 4. コンポーネント連携のemitが動かない 27 原因1〜3を修正した後😆
  • 28. Copyright  (C) 2021 Toranoana Inc. All Rights Reserved. 困ったら、公式ドキュメントをみよ う! 28 Vueは日本語のドキュメントが整備されてるので助かる!
  • 29. Copyright  (C) 2021 Toranoana Inc. All Rights Reserved. まとめ! 29 Vue3でサービスを作ってみた感想 🙌
  • 30. Copyright  (C) 2021 Toranoana Inc. All Rights Reserved. 7. まとめ Vue3はVue2/Nuxt.jsの知識がそこそこ活かせる。 困ったら、 1. Vue3の公式サイト(日本語) 2. StackOverflow(英語の方) 3. vuejs/vue-next(英語)のIssueを探す (開発する前に、テックカンファレンスの藤原さんの登壇資料を読むとすんなり入れます) (情報量が少ないので、困ったら公式。新しいフレームワークあるある。) 30
  • 31. Copyright  (C) 2021 Toranoana Inc. All Rights Reserved. ご静聴、ありがとうございました 31