template-ref.spec.ts — vue Source File
Architecture documentation for template-ref.spec.ts, a typescript file in the vue codebase. 1 imports, 0 dependents.
Entity Profile
Dependency Diagram
graph LR 77619f96_f150_a10b_5cdc_708b58b20d01["template-ref.spec.ts"] c5601857_7faf_30c6_efca_20de90db006c["vue"] 77619f96_f150_a10b_5cdc_708b58b20d01 --> c5601857_7faf_30c6_efca_20de90db006c style 77619f96_f150_a10b_5cdc_708b58b20d01 fill:#6366f1,stroke:#818cf8,color:#fff
Relationship Graph
Source Code
import Vue from 'vue'
describe('ref', () => {
type TestShape = {
id: string
template: string
data?: any
components?: any
}
type ComponentShape = {
test: TestShape
test2: TestShape
test3: TestShape
}
const components: ComponentShape = {
test: {
id: 'test',
template: '<div>test</div>'
},
test2: {
id: 'test2',
template: '<div>test2</div>'
},
test3: {
id: 'test3',
template: '<div>test3</div>'
}
}
it('should work', () => {
const vm = new Vue({
data: {
value: 'bar'
},
template: `<div>
<test ref="foo"></test>
<test2 :ref="value"></test2>
<test3 :ref="0"></test3>
</div>`,
components
})
vm.$mount()
expect(vm.$refs.foo).toBeTruthy()
expect(vm.$refs.foo.$options.id).toBe('test')
expect(vm.$refs.bar).toBeTruthy()
expect(vm.$refs.bar.$options.id).toBe('test2')
expect(vm.$refs['0']).toBeTruthy()
expect(vm.$refs['0'].$options.id).toBe('test3')
})
it('should dynamically update refs', done => {
const vm = new Vue({
data: {
value: 'foo'
},
template: '<div :ref="value"></div>'
}).$mount()
expect(vm.$refs.foo).toBe(vm.$el)
vm.value = 'bar'
waitForUpdate(() => {
// ... (193 more lines)
Types
Dependencies
- vue
Source
Frequently Asked Questions
What does template-ref.spec.ts do?
template-ref.spec.ts is a source file in the vue codebase, written in typescript.
What does template-ref.spec.ts depend on?
template-ref.spec.ts imports 1 module(s): vue.
Where is template-ref.spec.ts in the architecture?
template-ref.spec.ts is located at test/unit/features/template-ref.spec.ts (directory: test/unit/features).
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free