mirror of https://github.com/vuejs/core.git
Merge 3be87c16bf
into 56be3dd4db
This commit is contained in:
commit
66237ce7f0
|
@ -8,7 +8,9 @@ import {
|
|||
reactive,
|
||||
readonly,
|
||||
ref,
|
||||
shallowRef,
|
||||
toRaw,
|
||||
triggerRef,
|
||||
} from '../src'
|
||||
|
||||
/**
|
||||
|
@ -520,3 +522,16 @@ describe('reactivity/readonly', () => {
|
|||
expect(r.value).toBe(ro)
|
||||
})
|
||||
})
|
||||
|
||||
test('should able to trigger on triggerRef', () => {
|
||||
const r = shallowRef({ a: 1 })
|
||||
const ror = readonly(r)
|
||||
let dummy
|
||||
effect(() => {
|
||||
dummy = ror.value.a
|
||||
})
|
||||
r.value.a = 2
|
||||
expect(dummy).toBe(1)
|
||||
triggerRef(ror)
|
||||
expect(dummy).toBe(2)
|
||||
})
|
||||
|
|
|
@ -93,6 +93,12 @@ export class Dep {
|
|||
*/
|
||||
sc: number = 0
|
||||
|
||||
/**
|
||||
* @internal
|
||||
*/
|
||||
readonly __v_skip = true
|
||||
// TODO isolatedDeclarations ReactiveFlags.SKIP
|
||||
|
||||
constructor(public computed?: ComputedRefImpl | undefined) {
|
||||
if (__DEV__) {
|
||||
this.subsHead = undefined
|
||||
|
|
Loading…
Reference in New Issue