mirror of
				https://github.com/go-gitea/gitea
				synced 2025-11-04 13:28:25 +00:00 
			
		
		
		
	Reorder blocks in vue SFCs (#26874)
The [recommended order](https://vuejs.org/guide/scaling-up/sfc.html) for SFC blocks is script -> template -> style, which we were violating because template and script were swapped. I do find script first also easier to read because the imports are on top, letting me immideatly see a component's dependencies. This is a pure cut-paste refactor with some removal of some empty lines. --------- Co-authored-by: Lauris BH <lauris@nix.lv>
This commit is contained in:
		@@ -1,28 +1,3 @@
 | 
			
		||||
<template>
 | 
			
		||||
  <div ref="root">
 | 
			
		||||
    <div v-if="loading" class="ui active centered inline loader"/>
 | 
			
		||||
    <div v-if="!loading && issue !== null">
 | 
			
		||||
      <p><small>{{ issue.repository.full_name }} on {{ createdAt }}</small></p>
 | 
			
		||||
      <p><svg-icon :name="icon" :class="['text', color]"/> <strong>{{ issue.title }}</strong> #{{ issue.number }}</p>
 | 
			
		||||
      <p>{{ body }}</p>
 | 
			
		||||
      <div>
 | 
			
		||||
        <div
 | 
			
		||||
          v-for="label in labels"
 | 
			
		||||
          :key="label.name"
 | 
			
		||||
          class="ui label"
 | 
			
		||||
          :style="{ color: label.textColor, backgroundColor: label.color }"
 | 
			
		||||
        >
 | 
			
		||||
          {{ label.name }}
 | 
			
		||||
        </div>
 | 
			
		||||
      </div>
 | 
			
		||||
    </div>
 | 
			
		||||
    <div v-if="!loading && issue === null">
 | 
			
		||||
      <p><small>{{ i18nErrorOccurred }}</small></p>
 | 
			
		||||
      <p>{{ i18nErrorMessage }}</p>
 | 
			
		||||
    </div>
 | 
			
		||||
  </div>
 | 
			
		||||
</template>
 | 
			
		||||
 | 
			
		||||
<script>
 | 
			
		||||
import $ from 'jquery';
 | 
			
		||||
import {SvgIcon} from '../svg.js';
 | 
			
		||||
@@ -115,3 +90,27 @@ export default {
 | 
			
		||||
  }
 | 
			
		||||
};
 | 
			
		||||
</script>
 | 
			
		||||
<template>
 | 
			
		||||
  <div ref="root">
 | 
			
		||||
    <div v-if="loading" class="ui active centered inline loader"/>
 | 
			
		||||
    <div v-if="!loading && issue !== null">
 | 
			
		||||
      <p><small>{{ issue.repository.full_name }} on {{ createdAt }}</small></p>
 | 
			
		||||
      <p><svg-icon :name="icon" :class="['text', color]"/> <strong>{{ issue.title }}</strong> #{{ issue.number }}</p>
 | 
			
		||||
      <p>{{ body }}</p>
 | 
			
		||||
      <div>
 | 
			
		||||
        <div
 | 
			
		||||
          v-for="label in labels"
 | 
			
		||||
          :key="label.name"
 | 
			
		||||
          class="ui label"
 | 
			
		||||
          :style="{ color: label.textColor, backgroundColor: label.color }"
 | 
			
		||||
        >
 | 
			
		||||
          {{ label.name }}
 | 
			
		||||
        </div>
 | 
			
		||||
      </div>
 | 
			
		||||
    </div>
 | 
			
		||||
    <div v-if="!loading && issue === null">
 | 
			
		||||
      <p><small>{{ i18nErrorOccurred }}</small></p>
 | 
			
		||||
      <p>{{ i18nErrorMessage }}</p>
 | 
			
		||||
    </div>
 | 
			
		||||
  </div>
 | 
			
		||||
</template>
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user