forked from vuejs/test-utils
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: include the mocks in component globalThis
fixes vuejs#2119
- Loading branch information
Showing
3 changed files
with
32 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
<script setup lang="ts"> | ||
import { ref } from 'vue' | ||
const hello = ref('hello') | ||
function clicked() { | ||
//@ts-ignore For example Nuxt will inject these kinds of global functions | ||
$fetch('http://www.example.com').then((response : any) => { | ||
hello.value = response.data | ||
}) | ||
} | ||
</script> | ||
|
||
<template> | ||
<button @click="clicked">{{ hello }}</button> | ||
</template> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters