Skip to content

Commit 9273594

Browse files
committed
docs(no-ref-as-operand): update docs
1 parent 17dbb8b commit 9273594

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

docs/rules/no-ref-as-operand.md

+3-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ You must use `.value` to access the `Ref` value.
2525
import { ref } from 'vue'
2626
2727
export default {
28-
setup() {
28+
setup(_props, { emit }) {
2929
const count = ref(0)
3030
const ok = ref(true)
3131
@@ -34,12 +34,14 @@ export default {
3434
count.value + 1
3535
1 + count.value
3636
var msg = ok.value ? 'yes' : 'no'
37+
emit('increment', count.value)
3738
3839
/* ✗ BAD */
3940
count++
4041
count + 1
4142
1 + count
4243
var msg = ok ? 'yes' : 'no'
44+
emit('increment', count)
4345
4446
return {
4547
count

0 commit comments

Comments
 (0)