@@ -211,11 +211,11 @@ tester.run('prefer-use-template-ref', rule, {
211
211
</div>
212
212
</template>
213
213
<script setup>
214
- import { ref } from 'vue';
214
+ import { ref, shallowRef } from 'vue';
215
215
function getFirstListItemElement() {
216
216
const firstListItem = ref();
217
217
const nestedCallback = () => {
218
- const second = ref ();
218
+ const second = shallowRef ();
219
219
console.log(second);
220
220
}
221
221
nestedCallback();
@@ -236,12 +236,12 @@ tester.run('prefer-use-template-ref', rule, {
236
236
</div>
237
237
</template>
238
238
<script>
239
- import { ref } from 'vue';
239
+ import { ref, shallowRef } from 'vue';
240
240
export default {
241
241
name: 'ComponentWithRefInBlock',
242
242
setup() {
243
243
function getFirstListItemElement() {
244
- const firstListItem = ref ();
244
+ const firstListItem = shallowRef ();
245
245
const nestedCallback = () => {
246
246
const second = ref();
247
247
console.log(second);
@@ -333,36 +333,6 @@ tester.run('prefer-use-template-ref', rule, {
333
333
}
334
334
]
335
335
} ,
336
- {
337
- filename : 'ref-in-block.vue' ,
338
- code : `
339
- <template>
340
- <div>
341
- <ul>
342
- <li ref="firstListItem">Morning</li>
343
- <li>Afternoon</li>
344
- <li>Evening</li>
345
- </ul>
346
- </div>
347
- </template>
348
- <script setup>
349
- import { ref } from 'vue';
350
- function getFirstListItemElement() {
351
- const firstListItem = ref();
352
- }
353
- </script>
354
- ` ,
355
- errors : [
356
- {
357
- messageId : 'preferUseTemplateRef' ,
358
- data : {
359
- name : 'ref'
360
- } ,
361
- line : 14 ,
362
- column : 33
363
- }
364
- ]
365
- } ,
366
336
{
367
337
filename : 'setup-function-only-refs.vue' ,
368
338
code : `
0 commit comments