-
Notifications
You must be signed in to change notification settings - Fork 345
[ソング] script setup構文に移行 #1789
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[ソング] script setup構文に移行 #1789
Conversation
Hiroshiba
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@romot-co @sigprogramming 共有です 🙏
この変更は便利なのですが、他の変更と必ずコンフリクトが発生します。
今複雑に変更しているファイルとかあったりされますか? 👀
以下、script setupの紹介です。
scriptのsetup構文は最近Vueに入った機能で、defineComponentが不要になり、template内で使っていた変数・関数をreturnする必要がなくなります。(コンパイラが勝手に良い感じにしてくれます)
差分が大きく見えますが、大体がインデントを2つ減らしてる形になってます。
Files changedで空白無視ボタンを押すととても見やすくなるはずです。
他はpropsやemitの記法が変わる感じです。emitは型が付くので使いやすくなります。
基本的にメリットしか無いのですが、移行の際に別PRと必ずコンフリクトが発生するのが難点です。
ちょうど今複雑な変更を書いてるとかあれば、そのファイルを除いてsetup化していく方針が良さそうに思ってます。
ということで、今変更しているファイルとかあればコメントいただけると! 🙏
(ちなみに空白無視git diffをすればコンフリクトしていても変更箇所がだいぶわかりやすいです)
Hiroshiba
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!!!
|
@Hiroshiba |
|
@Hiroshiba |
|
確認ありがとうございます!! |
内容
タイトル通りです。
関連 Issue
(なし)
スクリーンショット・動画など
(なし)
その他
コミットは分けておいたので、それぞれのコミットだけでPRすることも可能です。