mirror of
https://github.com/lainbo/component-party.git
synced 2026-04-05 13:09:03 +08:00
Change Vue 2 and Vue 3 examples to compact mode (#190)
This makes the code more comparable to Svelte, React, Alpine, etc.
This commit is contained in:
@@ -1,11 +1,7 @@
|
||||
<template>
|
||||
<div>
|
||||
<h1 class="title">
|
||||
I am red
|
||||
</h1>
|
||||
<button style="font-size: 10rem">
|
||||
I am a button
|
||||
</button>
|
||||
<h1 class="title">I am red</h1>
|
||||
<button style="font-size: 10rem">I am a button</button>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
|
||||
@@ -1,10 +1,6 @@
|
||||
<template>
|
||||
<h1 class="title">
|
||||
I am red
|
||||
</h1>
|
||||
<button style="font-size: 10rem">
|
||||
I am a button
|
||||
</button>
|
||||
<h1 class="title">I am red</h1>
|
||||
<button style="font-size: 10rem">I am a button</button>
|
||||
</template>
|
||||
|
||||
<style scoped>
|
||||
|
||||
@@ -16,8 +16,6 @@ export default {
|
||||
<template>
|
||||
<div>
|
||||
<p>Counter: {{ count }}</p>
|
||||
<button @click="incrementCount">
|
||||
+1
|
||||
</button>
|
||||
<button @click="incrementCount">+1</button>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@@ -9,7 +9,5 @@ function incrementCount() {
|
||||
|
||||
<template>
|
||||
<p>Counter: {{ count }}</p>
|
||||
<button @click="incrementCount">
|
||||
+1
|
||||
</button>
|
||||
<button @click="incrementCount">+1</button>
|
||||
</template>
|
||||
|
||||
@@ -21,9 +21,7 @@ export default {
|
||||
|
||||
<template>
|
||||
<div>
|
||||
<button @click="nextLight">
|
||||
Next light
|
||||
</button>
|
||||
<button @click="nextLight">Next light</button>
|
||||
<p>Light is: {{ light }}</p>
|
||||
<p>
|
||||
You must
|
||||
|
||||
@@ -11,9 +11,7 @@ function nextLight() {
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<button @click="nextLight">
|
||||
Next light
|
||||
</button>
|
||||
<button @click="nextLight">Next light</button>
|
||||
<p>Light is: {{ light }}</p>
|
||||
<p>
|
||||
You must
|
||||
|
||||
@@ -13,12 +13,8 @@ export default {
|
||||
|
||||
<template>
|
||||
<div>
|
||||
<button @click="clickYes">
|
||||
YES
|
||||
</button>
|
||||
<button @click="clickYes">YES</button>
|
||||
|
||||
<button @click="clickNo">
|
||||
NO
|
||||
</button>
|
||||
<button @click="clickNo">NO</button>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@@ -11,11 +11,7 @@ function clickNo() {
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<button @click="clickYes">
|
||||
YES
|
||||
</button>
|
||||
<button @click="clickYes">YES</button>
|
||||
|
||||
<button @click="clickNo">
|
||||
NO
|
||||
</button>
|
||||
<button @click="clickNo">NO</button>
|
||||
</template>
|
||||
|
||||
@@ -30,12 +30,8 @@ export default {
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<p v-if="isLoading">
|
||||
Fetching users...
|
||||
</p>
|
||||
<p v-else-if="error">
|
||||
An error ocurred while fetching users
|
||||
</p>
|
||||
<p v-if="isLoading">Fetching users...</p>
|
||||
<p v-else-if="error">An error ocurred while fetching users</p>
|
||||
<ul v-else-if="users">
|
||||
<li
|
||||
v-for="user in users"
|
||||
|
||||
@@ -5,12 +5,8 @@ const { isLoading, error, data: users } = useFetchUsers();
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<p v-if="isLoading">
|
||||
Fetching users...
|
||||
</p>
|
||||
<p v-else-if="error">
|
||||
An error ocurred while fetching users
|
||||
</p>
|
||||
<p v-if="isLoading">Fetching users...</p>
|
||||
<p v-else-if="error">An error ocurred while fetching users</p>
|
||||
<ul v-else-if="users">
|
||||
<li
|
||||
v-for="user in users"
|
||||
|
||||
@@ -62,6 +62,7 @@ export default [
|
||||
extends: ["eslint:recommended", "plugin:vue/vue3-recommended"],
|
||||
rules: {
|
||||
"vue/multi-word-component-names": "off",
|
||||
"vue/singleline-html-element-content-newline": "off",
|
||||
},
|
||||
},
|
||||
playgroundURL: "https://sfc.vuejs.org",
|
||||
@@ -154,6 +155,7 @@ export default [
|
||||
extends: ["eslint:recommended", "plugin:vue/recommended"],
|
||||
rules: {
|
||||
"vue/multi-word-component-names": "off",
|
||||
"vue/singleline-html-element-content-newline": "off",
|
||||
},
|
||||
},
|
||||
playgroundURL: "",
|
||||
|
||||
Reference in New Issue
Block a user