Skip to content

Commit caeff97

Browse files
committed
docs: Fix missing script tag
1 parent 859412f commit caeff97

File tree

1 file changed

+36
-40
lines changed

1 file changed

+36
-40
lines changed

docs/api/index.md

Lines changed: 36 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -475,15 +475,15 @@ This is designed to mock variables injected by third party plugins, not Vue's na
475475
<button @click="onClick" />
476476
</template>
477477

478-
<>
478+
<script>
479479
export default {
480480
methods: {
481481
onClick() {
482482
this.$store.dispatch('click')
483483
}
484484
}
485485
}
486-
</>
486+
</script>
487487
```
488488
489489
`Component.spec.js`:
@@ -576,7 +576,7 @@ provide?: Record<any, any>
576576
<div>Theme is {{ theme }}</div>
577577
</template>
578578

579-
<>
579+
<script>
580580
import { inject } from 'vue'
581581

582582
export default {
@@ -587,7 +587,7 @@ export default {
587587
}
588588
}
589589
}
590-
</>
590+
</script>
591591
```
592592
593593
`Component.spec.js`:
@@ -650,13 +650,13 @@ Defaults to **false**.
650650
<another-component />
651651
</template>
652652

653-
<>
653+
<script>
654654
export default {
655655
components: {
656656
AnotherComponent
657657
}
658658
}
659-
</>
659+
</script>
660660
```
661661
662662
`AnotherComponent.vue`
@@ -713,13 +713,13 @@ It stubs `Transition` and `TransitionGroup` by default.
713713
<div><foo /></div>
714714
</template>
715715

716-
<>
716+
<script>
717717
import Foo from '@/Foo.vue'
718718

719719
export default {
720720
components: { Foo }
721721
}
722-
</>
722+
</script>
723723
```
724724
725725
`Component.spec.js`:
@@ -786,14 +786,14 @@ Defaults to **false**.
786786
<another-component />
787787
</template>
788788

789-
<>
789+
<script>
790790
export default {
791791
components: {
792792
AComponent,
793793
AnotherComponent
794794
}
795795
}
796-
</>
796+
</script>
797797
```
798798
799799
`Component.spec.js`
@@ -842,15 +842,15 @@ attributes(key?: string): { [key: string]: string } | string
842842
<div id="foo" :class="className" />
843843
</template>
844844

845-
<>
845+
<script>
846846
export default {
847847
data() {
848848
return {
849849
className: 'bar'
850850
}
851851
}
852852
}
853-
</>
853+
</script>
854854
```
855855
856856
`Component.spec.js`:
@@ -923,14 +923,14 @@ The arguments are stored in an array, so you can verify which arguments were emi
923923
`Component.vue`:
924924
925925
```vue
926-
<>
926+
<script>
927927
export default {
928928
created() {
929929
this.$emit('greet', 'hello')
930930
this.$emit('greet', 'goodbye')
931931
}
932932
}
933-
</>
933+
</script>
934934
```
935935
936936
`Component.spec.js`:
@@ -1096,11 +1096,11 @@ findComponent<T extends ComponentPublicInstance>(selector: any): VueWrapper<T>
10961096
<div class="foo">Foo</div>
10971097
</template>
10981098

1099-
<>
1099+
<script>
11001100
export default {
11011101
name: 'Foo'
11021102
}
1103-
</>
1103+
</script>
11041104
```
11051105
11061106
`Component.vue`:
@@ -1110,13 +1110,13 @@ export default {
11101110
<Foo data-test="foo" ref="foo" class="foo" />
11111111
</template>
11121112

1113-
<>
1113+
<script>
11141114
import Foo from '@/Foo'
11151115

11161116
export default {
11171117
components: { Foo }
11181118
}
1119-
</>
1119+
</script>
11201120
```
11211121
11221122
`Component.spec.js`
@@ -1257,11 +1257,11 @@ It is similar to `findComponent`, but `getComponent` throws instead of returning
12571257
<div class="foo">Foo</div>
12581258
</template>
12591259

1260-
<>
1260+
<script>
12611261
export default {
12621262
name: 'Foo'
12631263
}
1264-
</>
1264+
</script>
12651265
```
12661266
12671267
`Component.vue`:
@@ -1271,13 +1271,13 @@ export default {
12711271
<Foo />
12721272
</template>
12731273

1274-
<>
1274+
<script>
12751275
import Foo from '@/Foo'
12761276

12771277
export default {
12781278
components: { Foo }
12791279
}
1280-
</>
1280+
</script>
12811281
```
12821282
12831283
`Component.spec.js`
@@ -1389,13 +1389,13 @@ export default {
13891389
<Component truthy :object="{}" string="string" />
13901390
</template>
13911391

1392-
<>
1392+
<script>
13931393
import Component from '@/Component'
13941394

13951395
export default {
13961396
components: { Component }
13971397
}
1398-
</>
1398+
</script>
13991399
```
14001400
14011401
`Component.spec.js`:
@@ -1449,15 +1449,15 @@ Also, notice that `setData` does not modify composition API `setup()` data.
14491449
<div>Count: {{ count }}</div>
14501450
</template>
14511451

1452-
<>
1452+
<script>
14531453
export default {
14541454
data() {
14551455
return {
14561456
count: 0
14571457
}
14581458
}
14591459
}
1460-
</>
1460+
</script>
14611461
```
14621462
14631463
`Component.spec.js`:
@@ -1499,11 +1499,11 @@ setProps(props: Record<string, any>): Promise<void>
14991499
<div>{{ message }}</div>
15001500
</template>
15011501

1502-
<>
1502+
<script>
15031503
export default {
15041504
props: ['message']
15051505
}
1506-
</>
1506+
</script>
15071507
```
15081508
15091509
`Component.spec.js`
@@ -1559,7 +1559,7 @@ setValue(value: any, prop?: string): Promise<void>
15591559
<div v-if="checked">The input has been checked!</div>
15601560
</template>
15611561

1562-
<>
1562+
<script>
15631563
export default {
15641564
data() {
15651565
return {
@@ -1568,7 +1568,7 @@ export default {
15681568
}
15691569
}
15701570
}
1571-
</>
1571+
</script>
15721572
```
15731573
15741574
`Component.spec.js`:
@@ -1659,15 +1659,15 @@ trigger(eventString: string, options?: TriggerOptions | undefined): Promise<void
16591659
<button @click="count++">Click me</button>
16601660
</template>
16611661

1662-
<>
1662+
<script>
16631663
export default {
16641664
data() {
16651665
return {
16661666
count: 0
16671667
}
16681668
}
16691669
}
1670-
</>
1670+
</script>
16711671
```
16721672
16731673
`Component.spec.js`:
@@ -1712,17 +1712,13 @@ It only works on the root `VueWrapper` returned from `mount`. Useful for manual
17121712
`Component.vue`:
17131713
17141714
```vue
1715-
<template>
1716-
<div />
1717-
</template>
1718-
1719-
<>
1715+
<script>
17201716
export default {
17211717
unmounted() {
17221718
console.log('unmounted!')
17231719
}
17241720
}
1725-
</>
1721+
</script>
17261722
```
17271723
17281724
`Component.spec.js`:
@@ -1830,15 +1826,15 @@ An example might be globally mocking the `$t` variable from vue-i18n, globally s
18301826
<my-component />
18311827
</template>
18321828

1833-
<>
1829+
<script>
18341830
import MyComponent from '@/components/MyComponent'
18351831

18361832
export default {
18371833
components: {
18381834
MyComponent
18391835
}
18401836
}
1841-
</>
1837+
</script>
18421838
```
18431839
18441840
`Component.spec.js`:

0 commit comments

Comments
 (0)