Skip to content

Commit 9923502

Browse files
authored
test: disable autoImport (#1842)
1 parent 1f7d3a2 commit 9923502

File tree

11 files changed

+21
-2
lines changed

11 files changed

+21
-2
lines changed

src/runtime/composables/head.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import type { HeadObjectPlain } from '@vueuse/head'
33
import type { Ref } from 'vue'
44
import { hasProtocol, joinURL, withTrailingSlash, withoutTrailingSlash } from 'ufo'
55
import { ParsedContent } from '../types'
6-
import { useRoute, nextTick, useHead, unref, watch, useRuntimeConfig } from '#imports'
6+
import { useRoute, nextTick, useHead, unref, watch, useRuntimeConfig, useRequestEvent } from '#imports'
77

88
export const useContentHead = (
99
_content: ParsedContent | Ref<ParsedContent>,

test/fixtures/basic/.nuxtrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
imports.autoImport=false

test/fixtures/basic/pages/features/query-content.vue

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,9 @@
44
</div>
55
</template>
66

7-
<script setup>
7+
<script setup lang="ts">
8+
import { queryContent, useRoute, useAsyncData } from '#imports'
9+
810
const route = useRoute()
911
const prefix = route.query.prefix === undefined ? '/_partial' : ''
1012
const path = route.query.path || ''

test/fixtures/basic/pages/features/slotted-content-renderer.vue

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@
1313
</template>
1414

1515
<script setup lang="ts">
16+
import { queryContent, useAsyncData } from '#imports'
17+
1618
const path = '/'
1719
const { data } = await useAsyncData(`content-${path}`, () => queryContent().where({ _path: path, draft: { $ne: true } }).findOne())
1820
</script>

test/fixtures/basic/pages/locale-[locale].vue

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33
</template>
44

55
<script setup lang="ts">
6+
import { queryContent, useRoute, useAsyncData, computed } from '#imports'
7+
68
const route = useRoute()
79
const { data: list } = await useAsyncData(route.path, () => queryContent().locale(route.params.locale).find())
810
const ids = computed(() => list.value.map(item => item._id).join('\n'))

test/fixtures/basic/pages/nav-with-query.vue

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
<script lang="ts" setup>
2+
import { queryContent } from '#imports'
3+
24
const catsQuery = queryContent('cats')
35
46
const numbersQuery = queryContent('numbers')

test/fixtures/basic/pages/parse.vue

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@
55
</template>
66

77
<script setup>
8+
import { useRoute, useAsyncData } from '#imports'
9+
810
const { content } = useRoute().query
911
const { data } = await useAsyncData(content, async () => {
1012
return await $fetch('/api/parse', {

test/fixtures/document-driven/pages/custom-search.vue

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
<script setup>
2+
import { definePageMeta, useContent, useContentHead } from '#imports'
3+
24
definePageMeta({
35
documentDriven: {
46
page: {

test/fixtures/document-driven/pages/disabled.vue

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@
77
</template>
88

99
<script setup lang="ts">
10+
import { definePageMeta, useContent } from '#imports'
11+
1012
definePageMeta({
1113
documentDriven: false
1214
})

test/fixtures/document-driven/pages/home.vue

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
<script setup>
2+
import { definePageMeta, useContent, useContentHead } from '#imports'
3+
24
definePageMeta({
35
documentDriven: {
46
page: '/',

test/fixtures/document-driven/pages/no-surround.vue

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@
77
</template>
88

99
<script setup lang="ts">
10+
import { definePageMeta, useContent } from '#imports'
11+
1012
definePageMeta({
1113
documentDriven: {
1214
surround: false

0 commit comments

Comments
 (0)