]> git.ipfire.org Git - thirdparty/vuejs/core.git/commitdiff
style: format html files
author三咲智子 Kevin Deng <sxzz@sxzz.moe>
Wed, 7 Aug 2024 11:58:07 +0000 (19:58 +0800)
committer三咲智子 Kevin Deng <sxzz@sxzz.moe>
Wed, 7 Aug 2024 11:58:07 +0000 (19:58 +0800)
packages/vue/__tests__/e2e/hydration-strat-custom.html
packages/vue/__tests__/e2e/hydration-strat-idle.html
packages/vue/__tests__/e2e/hydration-strat-interaction.html
packages/vue/__tests__/e2e/hydration-strat-media.html
packages/vue/__tests__/e2e/hydration-strat-visible.html
packages/vue/__tests__/e2e/trusted-types.html

index c0b9c5c9793ead0d7a193410f14b3f64ee88ae99..a479a84bdb50d23fe3f61811275e0b7fb2df1aeb 100644 (file)
         window.teardownCalled = true
         triggerEl.removeEventListener('click', hydrate)
       }
-    }
+    },
   })
 
-  const show = window.show = ref(true)
+  const show = (window.show = ref(true))
   createSSRApp({
     setup() {
       onMounted(() => {
         window.isRootMounted = true
       })
-      return () => show.value ? h(AsyncComp) : 'off'
-    }
+      return () => (show.value ? h(AsyncComp) : 'off')
+    },
   }).mount('#app')
 </script>
index 5601713125750ce46a437a290ad43f723b81e082..23e3aa32a59d5f4776af0cb76d1b92265672600b 100644 (file)
@@ -4,7 +4,14 @@
 
 <script>
   window.isHydrated = false
-  const { createSSRApp, defineAsyncComponent, h, ref, onMounted, hydrateOnIdle } = Vue
+  const {
+    createSSRApp,
+    defineAsyncComponent,
+    h,
+    ref,
+    onMounted,
+    hydrateOnIdle,
+  } = Vue
 
   const Comp = {
     setup() {
   }
 
   const AsyncComp = defineAsyncComponent({
-    loader: () => new Promise(resolve => {
-      setTimeout(() => {
-        console.log('resolve')
-        resolve(Comp)
-        requestIdleCallback(() => {
-          console.log('busy')
-        })
-      }, 10)
-    }),
-    hydrate: hydrateOnIdle()
+    loader: () =>
+      new Promise(resolve => {
+        setTimeout(() => {
+          console.log('resolve')
+          resolve(Comp)
+          requestIdleCallback(() => {
+            console.log('busy')
+          })
+        }, 10)
+      }),
+    hydrate: hydrateOnIdle(),
   })
 
   createSSRApp({
-    render: () => h(AsyncComp)
+    render: () => h(AsyncComp),
   }).mount('#app')
 </script>
index 9f4f44d99c82f744ca3e374df93ab9234fe23f82..443fcbfa18f268320d8cdec5282c77239d22f95f 100644 (file)
@@ -2,7 +2,11 @@
 
 <div>click to hydrate</div>
 <div id="app"><button>0</button></div>
-<style>body { margin: 0 }</style>
+<style>
+  body {
+    margin: 0;
+  }
+</style>
 
 <script>
   const isFragment = location.search.includes('?fragment')
   }
 
   window.isHydrated = false
-  const { createSSRApp, defineAsyncComponent, h, ref, onMounted, hydrateOnInteraction } = Vue
+  const {
+    createSSRApp,
+    defineAsyncComponent,
+    h,
+    ref,
+    onMounted,
+    hydrateOnInteraction,
+  } = Vue
 
   const Comp = {
     setup() {
         window.isHydrated = true
       })
       return () => {
-        const button = h('button', { onClick: () => count.value++ }, count.value)
+        const button = h(
+          'button',
+          { onClick: () => count.value++ },
+          count.value,
+        )
         if (isFragment) {
           return [[h('span', 'one')], button, h('span', 'two')]
         } else {
@@ -34,7 +49,7 @@
 
   const AsyncComp = defineAsyncComponent({
     loader: () => Promise.resolve(Comp),
-    hydrate: hydrateOnInteraction(['click', 'wheel'])
+    hydrate: hydrateOnInteraction(['click', 'wheel']),
   })
 
   createSSRApp({
@@ -43,6 +58,6 @@
         window.isRootMounted = true
       })
       return () => h(AsyncComp)
-    }
+    },
   }).mount('#app')
 </script>
index f8d30a09ba388bb3cfa23d4bc8bea81c51959a15..c04cdb2a7838549e8a01489651b8f2b4db80c243 100644 (file)
@@ -5,7 +5,14 @@
 
 <script>
   window.isHydrated = false
-  const { createSSRApp, defineAsyncComponent, h, ref, onMounted, hydrateOnMediaQuery } = Vue
+  const {
+    createSSRApp,
+    defineAsyncComponent,
+    h,
+    ref,
+    onMounted,
+    hydrateOnMediaQuery,
+  } = Vue
 
   const Comp = {
     setup() {
@@ -22,7 +29,7 @@
 
   const AsyncComp = defineAsyncComponent({
     loader: () => Promise.resolve(Comp),
-    hydrate: hydrateOnMediaQuery('(max-width:500px)')
+    hydrate: hydrateOnMediaQuery('(max-width:500px)'),
   })
 
   createSSRApp({
@@ -31,6 +38,6 @@
         window.isRootMounted = true
       })
       return () => h(AsyncComp)
-    }
+    },
   }).mount('#app')
 </script>
index 6420ca9fe4fff4c49eb9c8ac9fbf4acbcafa324a..7b3b5ddf35dca1b563eb9088e68203f8bc4cd179 100644 (file)
@@ -2,7 +2,11 @@
 
 <div style="height: 1000px">scroll to the bottom to hydrate</div>
 <div id="app"><button>0</button></div>
-<style>body { margin: 0 }</style>
+<style>
+  body {
+    margin: 0;
+  }
+</style>
 
 <script>
   const rootMargin = location.search.match(/rootMargin=(\d+)/)?.[1] ?? 0
   }
 
   window.isHydrated = false
-  const { createSSRApp, defineAsyncComponent, h, ref, onMounted, hydrateOnVisible } = Vue
+  const {
+    createSSRApp,
+    defineAsyncComponent,
+    h,
+    ref,
+    onMounted,
+    hydrateOnVisible,
+  } = Vue
 
   const Comp = {
     setup() {
         window.isHydrated = true
       })
       return () => {
-        const button = h('button', { onClick: () => count.value++ }, count.value)
+        const button = h(
+          'button',
+          { onClick: () => count.value++ },
+          count.value,
+        )
         if (isFragment) {
           return [[h('span', 'one')], button, h('span', 'two')]
         } else {
@@ -35,7 +50,7 @@
 
   const AsyncComp = defineAsyncComponent({
     loader: () => Promise.resolve(Comp),
-    hydrate: hydrateOnVisible({rootMargin: rootMargin + 'px'})
+    hydrate: hydrateOnVisible({ rootMargin: rootMargin + 'px' }),
   })
 
   createSSRApp({
@@ -44,6 +59,6 @@
         window.isRootMounted = true
       })
       return () => h(AsyncComp)
-    }
+    },
   }).mount('#app')
 </script>
index a5743a6309019ef433a5aa5441c148b283327a36..181dd0465daeb881220547610545d1f71e838bb6 100644 (file)
@@ -2,7 +2,7 @@
 <html lang="en">
   <head>
     <meta charset="UTF-8" />
-    <link rel="icon" href="data:;base64,iVBORw0KGgo=">
+    <link rel="icon" href="data:;base64,iVBORw0KGgo=" />
     <meta
       http-equiv="content-security-policy"
       content="require-trusted-types-for 'script'"