fix: resolve all ESLint errors in Vue components
Fixed 22 ESLint errors across 26 Vue component files: - Removed TypeScript type annotations from ReadingProgress.vue (converted to JS) - Removed unused variables, imports, and duplicate function declarations - Fixed HTML parsing errors (invalid attribute names, unclosed tags) - Added missing :key directives to v-for loops - Fixed duplicate object keys (backgroundImage) - Replaced special characters in comments to avoid parsing issues - Fixed malformed HTML tags (v-else", 003e attributes) All warnings were left unchanged as requested. Build now passes with 0 errors. Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -83,7 +83,7 @@
|
||||
</div>
|
||||
|
||||
<div
|
||||
v-for="(task, idx) in tasks"
|
||||
v-for="task in tasks"
|
||||
:key="task.id"
|
||||
class="thread-row"
|
||||
>
|
||||
@@ -165,7 +165,6 @@
|
||||
<script setup>
|
||||
import { ref, computed, watch } from 'vue'
|
||||
|
||||
const comparisonMode = ref('memory')
|
||||
const coroutineCount = ref(1000)
|
||||
const isRunning = ref(false)
|
||||
const showDetails = ref(false)
|
||||
|
||||
+2
-2
@@ -91,7 +91,7 @@
|
||||
|
||||
<div class="task-timeline">
|
||||
<div
|
||||
v-for="(task, idx) in demoTasks"
|
||||
v-for="task in demoTasks"
|
||||
:key="task.id"
|
||||
class="task-row"
|
||||
>
|
||||
@@ -184,7 +184,7 @@
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { ref, computed } from 'vue'
|
||||
import { ref } from 'vue'
|
||||
|
||||
const demoMode = ref('concurrent')
|
||||
const isRunning = ref(false)
|
||||
|
||||
-38
@@ -276,47 +276,9 @@ const insightDescription = computed(() => {
|
||||
})
|
||||
|
||||
// 方法
|
||||
function addThread() {
|
||||
// 模拟添加线程
|
||||
}
|
||||
|
||||
function killThread() {
|
||||
// 模拟结束线程
|
||||
}
|
||||
|
||||
function simulateCrash() {
|
||||
// 模拟崩溃
|
||||
}
|
||||
|
||||
function reset() {
|
||||
coroutineCount.value = 1000
|
||||
}
|
||||
|
||||
function startSimulation() {
|
||||
// 开始模拟
|
||||
}
|
||||
|
||||
function toggleSimulation() {
|
||||
// 切换模拟状态
|
||||
}
|
||||
|
||||
function pauseSimulation() {
|
||||
// 暂停模拟
|
||||
}
|
||||
|
||||
function runSimulation() {
|
||||
// 运行模拟
|
||||
}
|
||||
|
||||
function stateText(state) {
|
||||
const texts = {
|
||||
ready: '就绪',
|
||||
running: '运行中',
|
||||
blocked: '阻塞',
|
||||
completed: '已完成'
|
||||
}
|
||||
return texts[state] || state
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
|
||||
@@ -219,7 +219,7 @@
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { ref, computed } from 'vue'
|
||||
import { ref } from 'vue'
|
||||
|
||||
const isRunning = ref(false)
|
||||
const simulationSpeed = ref(2)
|
||||
|
||||
+1
-1
@@ -167,7 +167,7 @@
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { ref, computed, watch } from 'vue'
|
||||
import { ref, watch } from 'vue'
|
||||
|
||||
const gmpDescription = 'G (Goroutine): 待执行的任务。M (Machine): 操作系统线程,执行 G 的载体。P (Processor): 逻辑处理器,提供执行上下文。G 先放入 P 的本地队列,P 与 M 绑定后,M 从 P 获取 G 执行。当本地队列空时,会从全局队列或其他 P 偷任务。'
|
||||
|
||||
|
||||
@@ -145,26 +145,6 @@ const currentInfo = computed(() => {
|
||||
}
|
||||
})
|
||||
|
||||
function createProcess() {
|
||||
if (processes.value.length >= 4) return
|
||||
|
||||
const id = processes.value.length + 1
|
||||
const size = 20 + Math.random() * 10
|
||||
|
||||
processes.value.push({
|
||||
id,
|
||||
pid: pidCounter++,
|
||||
size,
|
||||
color: colors[id - 1],
|
||||
codeSize: Math.floor(size * 0.15),
|
||||
dataSize: Math.floor(size * 0.1),
|
||||
heapSize: Math.floor(size * 0.6),
|
||||
stackSize: Math.floor(size * 0.15),
|
||||
crashed: false,
|
||||
active: true
|
||||
})
|
||||
}
|
||||
|
||||
function killProcess() {
|
||||
if (processes.value.length === 0) return
|
||||
processes.value.pop()
|
||||
|
||||
-1
@@ -164,7 +164,6 @@ async function startSimulation() {
|
||||
isRunning.value = true
|
||||
|
||||
const startTime = Date.now()
|
||||
const taskCount = pendingTasks.value.length
|
||||
const baseSwitchCost = model.value === 'process' ? 10 : model.value === 'thread' ? 2 : 1
|
||||
|
||||
// 模拟任务处理
|
||||
|
||||
@@ -176,7 +176,6 @@ const startTime = ref(null)
|
||||
|
||||
let animationId = null
|
||||
let currentThreadIndex = 0
|
||||
let timeQuantum = 50 // 时间片长度
|
||||
|
||||
const colors = ['#409eff', '#67c23a', '#e6a23c', '#f56c6c', '#909399', '#b3d8ff']
|
||||
|
||||
|
||||
Reference in New Issue
Block a user