Skip to content

Commit

Permalink
script setup:template、script、styleの順序を統一 (#1100)
Browse files Browse the repository at this point in the history
  • Loading branch information
sevenc-nanashi authored Jan 11, 2023
1 parent 327794f commit 2830cc0
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 8 deletions.
6 changes: 6 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,12 @@ module.exports = {
ignoreRestSiblings: true,
},
],
"vue/component-tags-order": [
"error",
{
order: ["template", "script", "style"],
},
],
},
overrides: [
{
Expand Down
5 changes: 5 additions & 0 deletions docs/細かい設計方針.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,8 @@ VOICEVOX は歴史的経緯により、 SpeakerId と StyleId が混同してい
(エンジン API の SpeakerId 引数に StyleId を渡したりなど。)

StyleId は現在整数値型になっていますが、将来的にはUuidにしたいと考えています。

## シングルファイルコンポーネント(SFC、`.vue`ファイル)のtemplate、script、styleの順序

`<template>``<script>``<style>`の順序で記述してください。

16 changes: 8 additions & 8 deletions src/components/MenuItem.vue
Original file line number Diff line number Diff line change
Expand Up @@ -60,14 +60,6 @@
</q-item>
</template>

<style lang="scss" scoped>
.engine-icon {
width: 24px;
height: 24px;
border-radius: 2px;
}
</style>

<script lang="ts">
import { defineComponent, ref, PropType, computed, watch } from "vue";
import type { MenuItemData } from "@/components/MenuBar.vue";
Expand Down Expand Up @@ -152,3 +144,11 @@ export default defineComponent({
},
});
</script>

<style lang="scss" scoped>
.engine-icon {
width: 24px;
height: 24px;
border-radius: 2px;
}
</style>

0 comments on commit 2830cc0

Please sign in to comment.