repo stringlengths 7 64 | file_url stringlengths 81 338 | file_path stringlengths 5 257 | content stringlengths 0 32.8k | language stringclasses 1
value | license stringclasses 7
values | commit_sha stringlengths 40 40 | retrieved_at stringdate 2026-01-04 15:25:31 2026-01-05 01:50:38 | truncated bool 2
classes |
|---|---|---|---|---|---|---|---|---|
vuejs/vue | https://github.com/vuejs/vue/blob/9e88707940088cb1f4cd7dd210c9168a50dc347c/test/unit/features/directives/for.spec.ts | test/unit/features/directives/for.spec.ts | import Vue from 'vue'
import { hasSymbol } from 'core/util/env'
describe('Directive v-for', () => {
it('should render array of primitive values', done => {
const vm = new Vue({
template: `
<div>
<span v-for="item in list">{{item}}</span>
</div>
`,
data: {
list:... | typescript | MIT | 9e88707940088cb1f4cd7dd210c9168a50dc347c | 2026-01-04T15:25:31.454261Z | false |
vuejs/vue | https://github.com/vuejs/vue/blob/9e88707940088cb1f4cd7dd210c9168a50dc347c/test/unit/features/directives/once.spec.ts | test/unit/features/directives/once.spec.ts | import Vue from 'vue'
describe('Directive v-once', () => {
it('should not rerender component', done => {
const vm = new Vue({
template: '<div v-once>{{ a }}</div>',
data: { a: 'hello' }
}).$mount()
expect(vm.$el.innerHTML).toBe('hello')
vm.a = 'world'
waitForUpdate(() => {
expec... | typescript | MIT | 9e88707940088cb1f4cd7dd210c9168a50dc347c | 2026-01-04T15:25:31.454261Z | false |
vuejs/vue | https://github.com/vuejs/vue/blob/9e88707940088cb1f4cd7dd210c9168a50dc347c/test/unit/features/directives/style.spec.ts | test/unit/features/directives/style.spec.ts | import Vue from 'vue'
function checkPrefixedProp(prop) {
const el = document.createElement('div')
const upper = prop.charAt(0).toUpperCase() + prop.slice(1)
if (!(prop in el.style)) {
const prefixes = ['Webkit', 'Moz', 'ms']
let i = prefixes.length
while (i--) {
if (prefixes[i] + upper in el.st... | typescript | MIT | 9e88707940088cb1f4cd7dd210c9168a50dc347c | 2026-01-04T15:25:31.454261Z | false |
vuejs/vue | https://github.com/vuejs/vue/blob/9e88707940088cb1f4cd7dd210c9168a50dc347c/test/unit/features/directives/pre.spec.ts | test/unit/features/directives/pre.spec.ts | import Vue from 'vue'
describe('Directive v-pre', function () {
it('should not compile inner content', function () {
const vm = new Vue({
template: `<div>
<div v-pre>{{ a }}</div>
<div>{{ a }}</div>
<div v-pre>
<component is="div"></component>
</div>
</div>`,... | typescript | MIT | 9e88707940088cb1f4cd7dd210c9168a50dc347c | 2026-01-04T15:25:31.454261Z | false |
vuejs/vue | https://github.com/vuejs/vue/blob/9e88707940088cb1f4cd7dd210c9168a50dc347c/test/unit/features/directives/static-style-parser.spec.ts | test/unit/features/directives/static-style-parser.spec.ts | import { parseStyleText } from 'web/util/style'
const base64ImgUrl =
'url("data:image/webp;base64,UklGRkoAAABXRUJQVlA4WAoAAAAQAAAAAAAAAAAAQUxQSAwAAAARBxAR/Q9ERP8DAABWUDggGAAAABQBAJ0BKgEAAQAAAP4AAA3AAP7mtQAAAA==")'
const logoUrl = 'url(https://vuejs.org/images/logo.png)'
it('should parse normal static style', () => {... | typescript | MIT | 9e88707940088cb1f4cd7dd210c9168a50dc347c | 2026-01-04T15:25:31.454261Z | false |
vuejs/vue | https://github.com/vuejs/vue/blob/9e88707940088cb1f4cd7dd210c9168a50dc347c/test/unit/features/directives/on.spec.ts | test/unit/features/directives/on.spec.ts | import Vue from 'vue'
import { supportsPassive } from 'core/util/env'
import { SpyInstanceFn } from 'vitest'
describe('Directive v-on', () => {
let vm, spy: SpyInstanceFn, el: HTMLElement
beforeEach(() => {
vm = null
spy = vi.fn()
el = document.createElement('div')
document.body.appendChild(el)
... | typescript | MIT | 9e88707940088cb1f4cd7dd210c9168a50dc347c | 2026-01-04T15:25:31.454261Z | false |
vuejs/vue | https://github.com/vuejs/vue/blob/9e88707940088cb1f4cd7dd210c9168a50dc347c/test/unit/features/directives/model-radio.spec.ts | test/unit/features/directives/model-radio.spec.ts | import Vue from 'vue'
describe('Directive v-model radio', () => {
it('should work', done => {
const vm = new Vue({
data: {
test: '1'
},
template: `
<div>
<input type="radio" value="1" v-model="test" name="test">
<input type="radio" value="2" v-model="test" na... | typescript | MIT | 9e88707940088cb1f4cd7dd210c9168a50dc347c | 2026-01-04T15:25:31.454261Z | false |
vuejs/vue | https://github.com/vuejs/vue/blob/9e88707940088cb1f4cd7dd210c9168a50dc347c/test/unit/features/directives/class.spec.ts | test/unit/features/directives/class.spec.ts | import Vue from 'vue'
import { isFunction } from 'core/util'
function assertClass(assertions, done) {
const vm = new Vue({
template: '<div class="foo" :class="value"></div>',
data: { value: '' }
}).$mount()
const chain = waitForUpdate()
assertions.forEach(([value, expected], i) => {
chain
.th... | typescript | MIT | 9e88707940088cb1f4cd7dd210c9168a50dc347c | 2026-01-04T15:25:31.454261Z | false |
vuejs/vue | https://github.com/vuejs/vue/blob/9e88707940088cb1f4cd7dd210c9168a50dc347c/test/unit/features/directives/model-select.spec.ts | test/unit/features/directives/model-select.spec.ts | import Vue from 'vue'
import { looseEqual } from 'shared/util'
// Android 4.4 Chrome 30 has the bug that a multi-select option cannot be
// deselected by setting its "selected" prop via JavaScript.
function hasMultiSelectBug() {
const s = document.createElement('select')
s.setAttribute('multiple', '')
const o = ... | typescript | MIT | 9e88707940088cb1f4cd7dd210c9168a50dc347c | 2026-01-04T15:25:31.454261Z | false |
vuejs/vue | https://github.com/vuejs/vue/blob/9e88707940088cb1f4cd7dd210c9168a50dc347c/test/unit/features/directives/model-parse.spec.ts | test/unit/features/directives/model-parse.spec.ts | import { parseModel } from 'compiler/directives/model'
describe('model expression parser', () => {
it('parse single path', () => {
const res = parseModel('foo')
expect(res.exp).toBe('foo')
expect(res.key).toBe(null)
})
it('parse object dot notation', () => {
const res = parseModel('a.b.c')
e... | typescript | MIT | 9e88707940088cb1f4cd7dd210c9168a50dc347c | 2026-01-04T15:25:31.454261Z | false |
vuejs/vue | https://github.com/vuejs/vue/blob/9e88707940088cb1f4cd7dd210c9168a50dc347c/test/unit/features/directives/html.spec.ts | test/unit/features/directives/html.spec.ts | import Vue from 'vue'
describe('Directive v-html', () => {
it('should render html', () => {
const vm = new Vue({
template: '<div v-html="a"></div>',
data: { a: 'hello' }
}).$mount()
expect(vm.$el.innerHTML).toBe('hello')
})
it('should encode html entities', () => {
const vm = new Vue... | typescript | MIT | 9e88707940088cb1f4cd7dd210c9168a50dc347c | 2026-01-04T15:25:31.454261Z | false |
vuejs/vue | https://github.com/vuejs/vue/blob/9e88707940088cb1f4cd7dd210c9168a50dc347c/test/unit/features/directives/model-file.spec.ts | test/unit/features/directives/model-file.spec.ts | import Vue from 'vue'
describe('Directive v-model file', () => {
it('warn to use @change instead', () => {
new Vue({
data: {
file: ''
},
template: '<input v-model="file" type="file">'
}).$mount()
expect('Use a v-on:change listener instead').toHaveBeenWarned()
})
})
| typescript | MIT | 9e88707940088cb1f4cd7dd210c9168a50dc347c | 2026-01-04T15:25:31.454261Z | false |
vuejs/vue | https://github.com/vuejs/vue/blob/9e88707940088cb1f4cd7dd210c9168a50dc347c/test/unit/features/directives/model-dynamic.spec.ts | test/unit/features/directives/model-dynamic.spec.ts | import Vue from 'vue'
describe('Directive v-model dynamic input type', () => {
it('should work', done => {
const vm = new Vue({
data: {
inputType: null,
test: 'b'
},
template: `<input :type="inputType" v-model="test">`
}).$mount()
document.body.appendChild(vm.$el)
/... | typescript | MIT | 9e88707940088cb1f4cd7dd210c9168a50dc347c | 2026-01-04T15:25:31.454261Z | false |
vuejs/vue | https://github.com/vuejs/vue/blob/9e88707940088cb1f4cd7dd210c9168a50dc347c/test/unit/features/directives/model-checkbox.spec.ts | test/unit/features/directives/model-checkbox.spec.ts | import Vue from 'vue'
describe('Directive v-model checkbox', () => {
it('should work', done => {
const vm = new Vue({
data: {
test: true
},
template: '<input type="checkbox" v-model="test">'
}).$mount()
document.body.appendChild(vm.$el)
expect(vm.$el.checked).toBe(true)
... | typescript | MIT | 9e88707940088cb1f4cd7dd210c9168a50dc347c | 2026-01-04T15:25:31.454261Z | false |
vuejs/vue | https://github.com/vuejs/vue/blob/9e88707940088cb1f4cd7dd210c9168a50dc347c/test/unit/features/instance/render-proxy.spec.ts | test/unit/features/instance/render-proxy.spec.ts | import Vue from 'vue'
if (typeof Proxy !== 'undefined') {
describe('render proxy', () => {
it('should warn missing property in render fns with `with`', () => {
new Vue({
template: `<div>{{ a }}</div>`
}).$mount()
expect(`Property or method "a" is not defined`).toHaveBeenWarned()
})
... | typescript | MIT | 9e88707940088cb1f4cd7dd210c9168a50dc347c | 2026-01-04T15:25:31.454261Z | false |
vuejs/vue | https://github.com/vuejs/vue/blob/9e88707940088cb1f4cd7dd210c9168a50dc347c/test/unit/features/instance/init.spec.ts | test/unit/features/instance/init.spec.ts | import Vue from 'vue'
describe('Initialization', () => {
it('without new', () => {
try {
Vue()
} catch (e) {}
expect(
'Vue is a constructor and should be called with the `new` keyword'
).toHaveBeenWarned()
})
it('with new', () => {
expect(new Vue() instanceof Vue).toBe(true)
})... | typescript | MIT | 9e88707940088cb1f4cd7dd210c9168a50dc347c | 2026-01-04T15:25:31.454261Z | false |
vuejs/vue | https://github.com/vuejs/vue/blob/9e88707940088cb1f4cd7dd210c9168a50dc347c/test/unit/features/instance/methods-data.spec.ts | test/unit/features/instance/methods-data.spec.ts | import Vue from 'vue'
describe('Instance methods data', () => {
it('$set/$delete', done => {
const vm = new Vue({
template: '<div>{{ a.msg }}</div>',
data: {
a: {}
}
}).$mount()
expect(vm.$el.innerHTML).toBe('')
vm.$set(vm.a, 'msg', 'hello')
waitForUpdate(() => {
e... | typescript | MIT | 9e88707940088cb1f4cd7dd210c9168a50dc347c | 2026-01-04T15:25:31.454261Z | false |
vuejs/vue | https://github.com/vuejs/vue/blob/9e88707940088cb1f4cd7dd210c9168a50dc347c/test/unit/features/instance/methods-events.spec.ts | test/unit/features/instance/methods-events.spec.ts | import Vue from 'vue'
describe('Instance methods events', () => {
let vm, spy
beforeEach(() => {
vm = new Vue({})
spy = vi.fn()
})
it('$on', () => {
vm.$on('test', function () {
// expect correct context
expect(this).toBe(vm)
spy.apply(this, arguments)
})
vm.$emit('test',... | typescript | MIT | 9e88707940088cb1f4cd7dd210c9168a50dc347c | 2026-01-04T15:25:31.454261Z | false |
vuejs/vue | https://github.com/vuejs/vue/blob/9e88707940088cb1f4cd7dd210c9168a50dc347c/test/unit/features/instance/methods-lifecycle.spec.ts | test/unit/features/instance/methods-lifecycle.spec.ts | import Vue from 'vue'
import Dep from 'core/observer/dep'
describe('Instance methods lifecycle', () => {
describe('$mount', () => {
it('empty mount', () => {
const vm = new Vue({
data: { msg: 'hi' },
template: '<div>{{ msg }}</div>'
}).$mount()
expect(vm.$el.tagName).toBe('DIV')... | typescript | MIT | 9e88707940088cb1f4cd7dd210c9168a50dc347c | 2026-01-04T15:25:31.454261Z | false |
vuejs/vue | https://github.com/vuejs/vue/blob/9e88707940088cb1f4cd7dd210c9168a50dc347c/test/unit/features/instance/properties.spec.ts | test/unit/features/instance/properties.spec.ts | import Vue from 'vue'
describe('Instance properties', () => {
it('$data', () => {
const data = { a: 1 }
const vm = new Vue({
data
})
expect(vm.a).toBe(1)
expect(vm.$data).toBe(data)
// vm -> data
vm.a = 2
expect(data.a).toBe(2)
// data -> vm
data.a = 3
expect(vm.a).t... | typescript | MIT | 9e88707940088cb1f4cd7dd210c9168a50dc347c | 2026-01-04T15:25:31.454261Z | false |
vuejs/vue | https://github.com/vuejs/vue/blob/9e88707940088cb1f4cd7dd210c9168a50dc347c/test/unit/features/v3/apiWatch.spec.ts | test/unit/features/v3/apiWatch.spec.ts | import Vue from 'vue'
import {
watch,
watchEffect,
watchPostEffect,
watchSyncEffect,
reactive,
computed,
ref,
triggerRef,
shallowRef,
h,
onMounted,
getCurrentInstance,
effectScope,
TrackOpTypes,
TriggerOpTypes,
DebuggerEvent
} from 'v3'
import { nextTick } from 'core/util'
import { set }... | typescript | MIT | 9e88707940088cb1f4cd7dd210c9168a50dc347c | 2026-01-04T15:25:31.454261Z | false |
vuejs/vue | https://github.com/vuejs/vue/blob/9e88707940088cb1f4cd7dd210c9168a50dc347c/test/unit/features/v3/apiInject.spec.ts | test/unit/features/v3/apiInject.spec.ts | import Vue from 'vue'
import {
h,
provide,
inject,
InjectionKey,
ref,
nextTick,
Ref,
readonly,
reactive
} from 'v3/index'
// reference: https://vue-composition-api-rfc.netlify.com/api.html#provide-inject
describe('api: provide/inject', () => {
it('string keys', () => {
const Provider = {
... | typescript | MIT | 9e88707940088cb1f4cd7dd210c9168a50dc347c | 2026-01-04T15:25:31.454261Z | false |
vuejs/vue | https://github.com/vuejs/vue/blob/9e88707940088cb1f4cd7dd210c9168a50dc347c/test/unit/features/v3/apiAsyncComponent.spec.ts | test/unit/features/v3/apiAsyncComponent.spec.ts | import Vue from 'vue'
import { defineAsyncComponent, h, ref, nextTick, defineComponent } from 'v3'
import { Component } from 'types/component'
const timeout = (n: number = 0) => new Promise(r => setTimeout(r, n))
const loadingComponent = defineComponent({
template: `<div>loading</div>`
})
const resolvedComponent =... | typescript | MIT | 9e88707940088cb1f4cd7dd210c9168a50dc347c | 2026-01-04T15:25:31.454261Z | false |
vuejs/vue | https://github.com/vuejs/vue/blob/9e88707940088cb1f4cd7dd210c9168a50dc347c/test/unit/features/v3/apiLifecycle.spec.ts | test/unit/features/v3/apiLifecycle.spec.ts | import Vue from 'vue'
import {
h,
onBeforeMount,
onMounted,
ref,
reactive,
onBeforeUpdate,
onUpdated,
onBeforeUnmount,
onUnmounted,
onRenderTracked,
onRenderTriggered,
DebuggerEvent,
TrackOpTypes,
TriggerOpTypes
} from 'v3'
import { nextTick } from 'core/util'
describe('api: lifecycle hooks... | typescript | MIT | 9e88707940088cb1f4cd7dd210c9168a50dc347c | 2026-01-04T15:25:31.454261Z | false |
vuejs/vue | https://github.com/vuejs/vue/blob/9e88707940088cb1f4cd7dd210c9168a50dc347c/test/unit/features/v3/setupTemplateRef.spec.ts | test/unit/features/v3/setupTemplateRef.spec.ts | import Vue from 'vue'
import { ref, h, nextTick, reactive } from 'v3/index'
// reference: https://vue-composition-api-rfc.netlify.com/api.html#template-refs
describe('api: setup() template refs', () => {
it('string ref mount', () => {
const el = ref(null)
const Comp = {
setup() {
return {
... | typescript | MIT | 9e88707940088cb1f4cd7dd210c9168a50dc347c | 2026-01-04T15:25:31.454261Z | false |
vuejs/vue | https://github.com/vuejs/vue/blob/9e88707940088cb1f4cd7dd210c9168a50dc347c/test/unit/features/v3/useCssVars.spec.ts | test/unit/features/v3/useCssVars.spec.ts | import Vue from 'vue'
import { useCssVars, h, reactive, nextTick } from 'v3'
describe('useCssVars', () => {
async function assertCssVars(getApp: (state: any) => any) {
const state = reactive({ color: 'red' })
const App = getApp(state)
const vm = new Vue(App).$mount()
await nextTick()
expect((vm.$... | typescript | MIT | 9e88707940088cb1f4cd7dd210c9168a50dc347c | 2026-01-04T15:25:31.454261Z | false |
vuejs/vue | https://github.com/vuejs/vue/blob/9e88707940088cb1f4cd7dd210c9168a50dc347c/test/unit/features/v3/apiSetup.spec.ts | test/unit/features/v3/apiSetup.spec.ts | import { h, ref, reactive, isReactive, toRef, isRef } from 'v3'
import { nextTick } from 'core/util'
import { effect } from 'v3/reactivity/effect'
import Vue from 'vue'
function renderToString(comp: any) {
const vm = new Vue(comp).$mount()
return vm.$el.outerHTML
}
describe('api: setup context', () => {
it('sho... | typescript | MIT | 9e88707940088cb1f4cd7dd210c9168a50dc347c | 2026-01-04T15:25:31.454261Z | false |
vuejs/vue | https://github.com/vuejs/vue/blob/9e88707940088cb1f4cd7dd210c9168a50dc347c/test/unit/features/v3/reactivity/shallowReactive.spec.ts | test/unit/features/v3/reactivity/shallowReactive.spec.ts | import {
isReactive,
isRef,
isShallow,
reactive,
Ref,
ref,
shallowReactive,
shallowReadonly
} from 'v3'
describe('shallowReactive', () => {
test('should not make non-reactive properties reactive', () => {
const props = shallowReactive({ n: { foo: 1 } })
expect(isReactive(props.n)).toBe(false)... | typescript | MIT | 9e88707940088cb1f4cd7dd210c9168a50dc347c | 2026-01-04T15:25:31.454261Z | false |
vuejs/vue | https://github.com/vuejs/vue/blob/9e88707940088cb1f4cd7dd210c9168a50dc347c/test/unit/features/v3/reactivity/shallowReadonly.spec.ts | test/unit/features/v3/reactivity/shallowReadonly.spec.ts | import { isReactive, shallowReadonly, readonly, isReadonly } from 'v3'
describe('reactivity/shallowReadonly', () => {
test('should be readonly', () => {
expect(isReadonly(shallowReadonly({}))).toBe(true)
})
test('should not make non-reactive properties reactive', () => {
const props = shallowReadonly({ ... | typescript | MIT | 9e88707940088cb1f4cd7dd210c9168a50dc347c | 2026-01-04T15:25:31.454261Z | false |
vuejs/vue | https://github.com/vuejs/vue/blob/9e88707940088cb1f4cd7dd210c9168a50dc347c/test/unit/features/v3/reactivity/reactive.spec.ts | test/unit/features/v3/reactivity/reactive.spec.ts | import { ref, isRef, reactive, isReactive, toRaw, markRaw, computed } from 'v3'
import { set } from 'core/observer'
import { effect } from 'v3/reactivity/effect'
describe('reactivity/reactive', () => {
test('Object', () => {
const original = { foo: 1 }
const observed = reactive(original)
// @discrepancy ... | typescript | MIT | 9e88707940088cb1f4cd7dd210c9168a50dc347c | 2026-01-04T15:25:31.454261Z | false |
vuejs/vue | https://github.com/vuejs/vue/blob/9e88707940088cb1f4cd7dd210c9168a50dc347c/test/unit/features/v3/reactivity/ref.spec.ts | test/unit/features/v3/reactivity/ref.spec.ts | import {
ref,
isRef,
shallowRef,
unref,
triggerRef,
toRef,
toRefs,
customRef,
Ref,
isReactive,
isShallow,
reactive,
computed,
readonly
} from 'v3'
import { effect } from 'v3/reactivity/effect'
describe('reactivity/ref', () => {
it('should hold a value', () => {
const a = ref(1)
ex... | typescript | MIT | 9e88707940088cb1f4cd7dd210c9168a50dc347c | 2026-01-04T15:25:31.454261Z | false |
vuejs/vue | https://github.com/vuejs/vue/blob/9e88707940088cb1f4cd7dd210c9168a50dc347c/test/unit/features/v3/reactivity/effectScope.spec.ts | test/unit/features/v3/reactivity/effectScope.spec.ts | import Vue from 'vue'
import { nextTick } from 'core/util'
import {
watch,
watchEffect,
reactive,
computed,
ref,
ComputedRef,
EffectScope,
onScopeDispose,
getCurrentScope
} from 'v3/index'
import { effect } from 'v3/reactivity/effect'
describe('reactivity/effectScope', () => {
it('should run', () =... | typescript | MIT | 9e88707940088cb1f4cd7dd210c9168a50dc347c | 2026-01-04T15:25:31.454261Z | false |
vuejs/vue | https://github.com/vuejs/vue/blob/9e88707940088cb1f4cd7dd210c9168a50dc347c/test/unit/features/v3/reactivity/computed.spec.ts | test/unit/features/v3/reactivity/computed.spec.ts | import {
computed,
reactive,
ref,
isReadonly,
WritableComputedRef,
DebuggerEvent,
TrackOpTypes,
TriggerOpTypes
} from 'v3'
import { effect } from 'v3/reactivity/effect'
import { nextTick } from 'core/util'
import { set, del } from 'core/observer/index'
describe('reactivity/computed', () => {
it('shou... | typescript | MIT | 9e88707940088cb1f4cd7dd210c9168a50dc347c | 2026-01-04T15:25:31.454261Z | false |
vuejs/vue | https://github.com/vuejs/vue/blob/9e88707940088cb1f4cd7dd210c9168a50dc347c/test/unit/features/v3/reactivity/readonly.spec.ts | test/unit/features/v3/reactivity/readonly.spec.ts | import {
reactive,
readonly,
toRaw,
isReactive,
isReadonly,
markRaw,
ref,
isProxy
} from 'v3'
import { effect } from 'v3/reactivity/effect'
import { set, del } from 'core/observer'
/**
* @see https://www.typescriptlang.org/docs/handbook/release-notes/typescript-3-4.html
*/
type Writable<T> = { -reado... | typescript | MIT | 9e88707940088cb1f4cd7dd210c9168a50dc347c | 2026-01-04T15:25:31.454261Z | false |
vuejs/vue | https://github.com/vuejs/vue/blob/9e88707940088cb1f4cd7dd210c9168a50dc347c/test/unit/modules/util/next-tick.spec.ts | test/unit/modules/util/next-tick.spec.ts | import { nextTick } from 'core/util/next-tick'
describe('nextTick', () => {
it('accepts a callback', done => {
nextTick(done)
})
it('returns undefined when passed a callback', () => {
expect(nextTick(() => {})).toBeUndefined()
})
if (typeof Promise !== 'undefined') {
it('returns a Promise when ... | typescript | MIT | 9e88707940088cb1f4cd7dd210c9168a50dc347c | 2026-01-04T15:25:31.454261Z | false |
vuejs/vue | https://github.com/vuejs/vue/blob/9e88707940088cb1f4cd7dd210c9168a50dc347c/test/unit/modules/util/toString.spec.ts | test/unit/modules/util/toString.spec.ts | import { toString } from 'core/util/index'
import { ref } from 'v3'
test('should unwrap refs', () => {
expect(
toString({
a: ref(0),
b: { c: ref(1) }
})
).toBe(JSON.stringify({ a: 0, b: { c: 1 } }, null, 2))
})
| typescript | MIT | 9e88707940088cb1f4cd7dd210c9168a50dc347c | 2026-01-04T15:25:31.454261Z | false |
vuejs/vue | https://github.com/vuejs/vue/blob/9e88707940088cb1f4cd7dd210c9168a50dc347c/test/unit/modules/util/error.spec.ts | test/unit/modules/util/error.spec.ts | import Vue from 'vue'
import { invokeWithErrorHandling } from 'core/util/error'
describe('invokeWithErrorHandling', () => {
if (typeof Promise !== 'undefined') {
it('should errorHandler call once when nested calls return rejected promise', done => {
const originalHandler = Vue.config.errorHandler
con... | typescript | MIT | 9e88707940088cb1f4cd7dd210c9168a50dc347c | 2026-01-04T15:25:31.454261Z | false |
vuejs/vue | https://github.com/vuejs/vue/blob/9e88707940088cb1f4cd7dd210c9168a50dc347c/test/unit/modules/vdom/create-element.spec.ts | test/unit/modules/vdom/create-element.spec.ts | import Vue from 'vue'
import { createEmptyVNode } from 'core/vdom/vnode'
describe('create-element', () => {
it('render vnode with basic reserved tag using createElement', () => {
const vm = new Vue({
data: { msg: 'hello world' }
})
const h = vm.$createElement
const vnode = h('p', {})
expect... | typescript | MIT | 9e88707940088cb1f4cd7dd210c9168a50dc347c | 2026-01-04T15:25:31.454261Z | false |
vuejs/vue | https://github.com/vuejs/vue/blob/9e88707940088cb1f4cd7dd210c9168a50dc347c/test/unit/modules/vdom/create-component.spec.ts | test/unit/modules/vdom/create-component.spec.ts | import Vue from 'vue'
import { createComponent } from 'core/vdom/create-component'
import { setCurrentRenderingInstance } from 'core/instance/render'
describe('create-component', () => {
let vm
beforeEach(() => {
vm = new Vue({
template: '<p>{{msg}}</p>',
data() {
return { msg: 'hello, my c... | typescript | MIT | 9e88707940088cb1f4cd7dd210c9168a50dc347c | 2026-01-04T15:25:31.454261Z | false |
vuejs/vue | https://github.com/vuejs/vue/blob/9e88707940088cb1f4cd7dd210c9168a50dc347c/test/unit/modules/vdom/patch/element.spec.ts | test/unit/modules/vdom/patch/element.spec.ts | import Vue from 'vue'
import { patch } from 'web/runtime/patch'
import VNode from 'core/vdom/vnode'
describe('vdom patch: element', () => {
it('should create an element', () => {
const vnode = new VNode('p', { attrs: { id: '1' } }, [
createTextVNode('hello world')
])
const elm = patch(null, vnode)
... | typescript | MIT | 9e88707940088cb1f4cd7dd210c9168a50dc347c | 2026-01-04T15:25:31.454261Z | false |
vuejs/vue | https://github.com/vuejs/vue/blob/9e88707940088cb1f4cd7dd210c9168a50dc347c/test/unit/modules/vdom/patch/hooks.spec.ts | test/unit/modules/vdom/patch/hooks.spec.ts | import { patch } from 'web/runtime/patch'
import { createPatchFunction } from 'core/vdom/patch'
import baseModules from 'core/vdom/modules/index'
import * as nodeOps from 'web/runtime/node-ops'
import platformModules from 'web/runtime/modules/index'
import VNode from 'core/vdom/vnode'
const modules = baseModules.conca... | typescript | MIT | 9e88707940088cb1f4cd7dd210c9168a50dc347c | 2026-01-04T15:25:31.454261Z | false |
vuejs/vue | https://github.com/vuejs/vue/blob/9e88707940088cb1f4cd7dd210c9168a50dc347c/test/unit/modules/vdom/patch/children.spec.ts | test/unit/modules/vdom/patch/children.spec.ts | import { patch } from 'web/runtime/patch'
import VNode, { createEmptyVNode } from 'core/vdom/vnode'
function prop(name) {
return obj => {
return obj[name]
}
}
function map(fn, list) {
const ret: any[] = []
for (let i = 0; i < list.length; i++) {
ret[i] = fn(list[i])
}
return ret
}
function spanNu... | typescript | MIT | 9e88707940088cb1f4cd7dd210c9168a50dc347c | 2026-01-04T15:25:31.454261Z | false |
vuejs/vue | https://github.com/vuejs/vue/blob/9e88707940088cb1f4cd7dd210c9168a50dc347c/test/unit/modules/vdom/patch/edge-cases.spec.ts | test/unit/modules/vdom/patch/edge-cases.spec.ts | import Vue from 'vue'
import { SSR_ATTR } from 'shared/constants'
describe('vdom patch: edge cases', () => {
// exposed by #3406
// When a static vnode is inside v-for, it's possible for the same vnode
// to be used in multiple places, and its element will be replaced. This
// causes patch errors when node ops... | typescript | MIT | 9e88707940088cb1f4cd7dd210c9168a50dc347c | 2026-01-04T15:25:31.454261Z | false |
vuejs/vue | https://github.com/vuejs/vue/blob/9e88707940088cb1f4cd7dd210c9168a50dc347c/test/unit/modules/vdom/patch/hydration.spec.ts | test/unit/modules/vdom/patch/hydration.spec.ts | import Vue from 'vue'
import VNode from 'core/vdom/vnode'
import { patch } from 'web/runtime/patch'
import { SSR_ATTR } from 'shared/constants'
function createMockSSRDOM(innerHTML) {
const dom = document.createElement('div')
dom.setAttribute(SSR_ATTR, 'true')
dom.innerHTML = innerHTML
return dom
}
describe('v... | typescript | MIT | 9e88707940088cb1f4cd7dd210c9168a50dc347c | 2026-01-04T15:25:31.454261Z | false |
vuejs/vue | https://github.com/vuejs/vue/blob/9e88707940088cb1f4cd7dd210c9168a50dc347c/test/unit/modules/vdom/modules/attrs.spec.ts | test/unit/modules/vdom/modules/attrs.spec.ts | import Vue from 'vue'
import { patch } from 'web/runtime/patch'
import VNode from 'core/vdom/vnode'
import { xlinkNS } from 'web/util/index'
describe('vdom attrs module', () => {
it('should create an element with attrs', () => {
const vnode = new VNode('p', { attrs: { id: 1, class: 'class1' } })
const elm = ... | typescript | MIT | 9e88707940088cb1f4cd7dd210c9168a50dc347c | 2026-01-04T15:25:31.454261Z | false |
vuejs/vue | https://github.com/vuejs/vue/blob/9e88707940088cb1f4cd7dd210c9168a50dc347c/test/unit/modules/vdom/modules/style.spec.ts | test/unit/modules/vdom/modules/style.spec.ts | import { patch } from 'web/runtime/patch'
import VNode from 'core/vdom/vnode'
describe('vdom style module', () => {
it('should create an element with style', () => {
const vnode = new VNode('p', { style: { fontSize: '12px' } })
const elm = patch(null, vnode)
expect(elm.style.fontSize).toBe('12px')
})
... | typescript | MIT | 9e88707940088cb1f4cd7dd210c9168a50dc347c | 2026-01-04T15:25:31.454261Z | false |
vuejs/vue | https://github.com/vuejs/vue/blob/9e88707940088cb1f4cd7dd210c9168a50dc347c/test/unit/modules/vdom/modules/events.spec.ts | test/unit/modules/vdom/modules/events.spec.ts | import { patch } from 'web/runtime/patch'
import VNode from 'core/vdom/vnode'
describe('vdom events module', () => {
it('should attach event handler to element', () => {
const click = vi.fn()
const vnode = new VNode('a', { on: { click } })
const elm = patch(null, vnode)
document.body.appendChild(elm... | typescript | MIT | 9e88707940088cb1f4cd7dd210c9168a50dc347c | 2026-01-04T15:25:31.454261Z | false |
vuejs/vue | https://github.com/vuejs/vue/blob/9e88707940088cb1f4cd7dd210c9168a50dc347c/test/unit/modules/vdom/modules/class.spec.ts | test/unit/modules/vdom/modules/class.spec.ts | import { patch } from 'web/runtime/patch'
import VNode from 'core/vdom/vnode'
describe('vdom class module', () => {
it('should create an element with staticClass', () => {
const vnode = new VNode('p', { staticClass: 'class1' })
const elm = patch(null, vnode)
expect(elm).toHaveClass('class1')
})
it('... | typescript | MIT | 9e88707940088cb1f4cd7dd210c9168a50dc347c | 2026-01-04T15:25:31.454261Z | false |
vuejs/vue | https://github.com/vuejs/vue/blob/9e88707940088cb1f4cd7dd210c9168a50dc347c/test/unit/modules/vdom/modules/directive.spec.ts | test/unit/modules/vdom/modules/directive.spec.ts | import Vue from 'vue'
import { patch } from 'web/runtime/patch'
import VNode from 'core/vdom/vnode'
describe('vdom directive module', () => {
it('should work', () => {
const directive1 = {
bind: vi.fn(),
update: vi.fn(),
unbind: vi.fn()
}
const vm = new Vue({ directives: { directive1 } ... | typescript | MIT | 9e88707940088cb1f4cd7dd210c9168a50dc347c | 2026-01-04T15:25:31.454261Z | false |
vuejs/vue | https://github.com/vuejs/vue/blob/9e88707940088cb1f4cd7dd210c9168a50dc347c/test/unit/modules/vdom/modules/dom-props.spec.ts | test/unit/modules/vdom/modules/dom-props.spec.ts | import Vue from 'vue'
import { patch } from 'web/runtime/patch'
import VNode from 'core/vdom/vnode'
describe('vdom domProps module', () => {
it('should create an element with domProps', () => {
const vnode = new VNode('a', { domProps: { src: 'http://localhost/' } })
const elm = patch(null, vnode)
expect(... | typescript | MIT | 9e88707940088cb1f4cd7dd210c9168a50dc347c | 2026-01-04T15:25:31.454261Z | false |
vuejs/vue | https://github.com/vuejs/vue/blob/9e88707940088cb1f4cd7dd210c9168a50dc347c/test/unit/modules/observer/scheduler.spec.ts | test/unit/modules/observer/scheduler.spec.ts | import Vue from 'vue'
import {
MAX_UPDATE_COUNT,
queueWatcher as _queueWatcher
} from 'core/observer/scheduler'
function queueWatcher(watcher) {
watcher.vm = {} // mock vm
_queueWatcher(watcher)
}
describe('Scheduler', () => {
let spy
beforeEach(() => {
spy = vi.fn()
})
it('queueWatcher', done =>... | typescript | MIT | 9e88707940088cb1f4cd7dd210c9168a50dc347c | 2026-01-04T15:25:31.454261Z | false |
vuejs/vue | https://github.com/vuejs/vue/blob/9e88707940088cb1f4cd7dd210c9168a50dc347c/test/unit/modules/observer/dep.spec.ts | test/unit/modules/observer/dep.spec.ts | import Dep, { cleanupDeps } from 'core/observer/dep'
describe('Dep', () => {
let dep
beforeEach(() => {
dep = new Dep()
})
describe('instance', () => {
it('should be created with correct properties', () => {
expect(dep.subs.length).toBe(0)
expect(new Dep().id).toBe(dep.id + 1)
})
})... | typescript | MIT | 9e88707940088cb1f4cd7dd210c9168a50dc347c | 2026-01-04T15:25:31.454261Z | false |
vuejs/vue | https://github.com/vuejs/vue/blob/9e88707940088cb1f4cd7dd210c9168a50dc347c/test/unit/modules/observer/observer.spec.ts | test/unit/modules/observer/observer.spec.ts | import Vue from 'vue'
import {
Observer,
observe,
set as setProp,
del as delProp
} from 'core/observer/index'
import Dep from 'core/observer/dep'
import { hasOwn } from 'core/util/index'
describe('Observer', () => {
it('create on non-observables', () => {
// skip primitive value
const ob1 = observe(1... | typescript | MIT | 9e88707940088cb1f4cd7dd210c9168a50dc347c | 2026-01-04T15:25:31.454261Z | false |
vuejs/vue | https://github.com/vuejs/vue/blob/9e88707940088cb1f4cd7dd210c9168a50dc347c/test/unit/modules/observer/watcher.spec.ts | test/unit/modules/observer/watcher.spec.ts | import Vue from 'vue'
import Watcher from 'core/observer/watcher'
describe('Watcher', () => {
let vm, spy
beforeEach(() => {
vm = new Vue({
template: '<div></div>',
data: {
a: 1,
b: {
c: 2,
d: 4
},
c: 'c',
msg: 'yo'
}
}).$mount()... | typescript | MIT | 9e88707940088cb1f4cd7dd210c9168a50dc347c | 2026-01-04T15:25:31.454261Z | false |
vuejs/vue | https://github.com/vuejs/vue/blob/9e88707940088cb1f4cd7dd210c9168a50dc347c/test/unit/modules/compiler/parser.spec.ts | test/unit/modules/compiler/parser.spec.ts | import { parse } from 'compiler/parser/index'
import { extend } from 'shared/util'
import { baseOptions } from 'web/compiler/options'
import { isIE, isEdge } from 'core/util/env'
describe('parser', () => {
it('simple element', () => {
const ast = parse('<h1>hello world</h1>', baseOptions)
expect(ast.tag).toB... | typescript | MIT | 9e88707940088cb1f4cd7dd210c9168a50dc347c | 2026-01-04T15:25:31.454261Z | true |
vuejs/vue | https://github.com/vuejs/vue/blob/9e88707940088cb1f4cd7dd210c9168a50dc347c/test/unit/modules/compiler/codegen.spec.ts | test/unit/modules/compiler/codegen.spec.ts | import { parse } from 'compiler/parser/index'
import { optimize } from 'compiler/optimizer'
import { generate } from 'compiler/codegen'
import { isObject, isFunction, extend } from 'shared/util'
import { isReservedTag } from 'web/util/index'
import { baseOptions } from 'web/compiler/options'
import { BindingTypes } fro... | typescript | MIT | 9e88707940088cb1f4cd7dd210c9168a50dc347c | 2026-01-04T15:25:31.454261Z | false |
vuejs/vue | https://github.com/vuejs/vue/blob/9e88707940088cb1f4cd7dd210c9168a50dc347c/test/unit/modules/compiler/optimizer.spec.ts | test/unit/modules/compiler/optimizer.spec.ts | import { parse } from 'compiler/parser/index'
import { extend } from 'shared/util'
import { optimize } from 'compiler/optimizer'
import { baseOptions } from 'web/compiler/options'
describe('optimizer', () => {
it('simple', () => {
const ast = parse(
'<h1 id="section1"><span>hello world</span></h1>',
... | typescript | MIT | 9e88707940088cb1f4cd7dd210c9168a50dc347c | 2026-01-04T15:25:31.454261Z | false |
vuejs/vue | https://github.com/vuejs/vue/blob/9e88707940088cb1f4cd7dd210c9168a50dc347c/test/unit/modules/compiler/codeframe.spec.ts | test/unit/modules/compiler/codeframe.spec.ts | import { generateCodeFrame } from 'compiler/codeframe'
describe('codeframe', () => {
const source = `
<div>
<template key="one"></template>
<ul>
<li v-for="foobar">hi</li>
</ul>
<template key="two"></template>
</div>
`.trim()
it('line near top', () => {
const keyStart = source.indexOf(`key="on... | typescript | MIT | 9e88707940088cb1f4cd7dd210c9168a50dc347c | 2026-01-04T15:25:31.454261Z | false |
vuejs/vue | https://github.com/vuejs/vue/blob/9e88707940088cb1f4cd7dd210c9168a50dc347c/test/unit/modules/compiler/compiler-options.spec.ts | test/unit/modules/compiler/compiler-options.spec.ts | import Vue from 'vue'
import { compile } from 'web/compiler'
import { getAndRemoveAttr } from 'compiler/helpers'
describe('compile options', () => {
it('should be compiled', () => {
const { render, staticRenderFns, errors } = compile(
`
<div>
<input type="text" v-model="msg" required max="8" ... | typescript | MIT | 9e88707940088cb1f4cd7dd210c9168a50dc347c | 2026-01-04T15:25:31.454261Z | false |
vuejs/vue | https://github.com/vuejs/vue/blob/9e88707940088cb1f4cd7dd210c9168a50dc347c/test/unit/modules/server-compiler/compiler-options.spec.ts | test/unit/modules/server-compiler/compiler-options.spec.ts | import { ssrCompile } from 'server/compiler'
describe('ssrCompile options', () => {
it('comments', () => {
const compiled = ssrCompile(
`
<div>
<!-- test comments -->
</div>
`,
{ comments: true }
)
expect(compiled.render).toContain('<!-- test comments -->')
})
})
| typescript | MIT | 9e88707940088cb1f4cd7dd210c9168a50dc347c | 2026-01-04T15:25:31.454261Z | false |
vuejs/vue | https://github.com/vuejs/vue/blob/9e88707940088cb1f4cd7dd210c9168a50dc347c/types/common.d.ts | types/common.d.ts | export type Data = { [key: string]: unknown }
export type UnionToIntersection<U> = (
U extends any ? (k: U) => void : never
) extends (k: infer I) => void
? I
: never
// Conditional returns can enforce identical types.
// See here: https://github.com/Microsoft/TypeScript/issues/27024#issuecomment-421529650
// p... | typescript | MIT | 9e88707940088cb1f4cd7dd210c9168a50dc347c | 2026-01-04T15:25:31.454261Z | false |
vuejs/vue | https://github.com/vuejs/vue/blob/9e88707940088cb1f4cd7dd210c9168a50dc347c/types/v3-directive.d.ts | types/v3-directive.d.ts | import type { VNodeDirective, VNode } from './vnode'
export type DirectiveModifiers = Record<string, boolean>
export interface DirectiveBinding<V> extends Readonly<VNodeDirective> {
readonly modifiers: DirectiveModifiers
readonly value: V
readonly oldValue: V | null
}
export type DirectiveHook<T = any, Prev = ... | typescript | MIT | 9e88707940088cb1f4cd7dd210c9168a50dc347c | 2026-01-04T15:25:31.454261Z | false |
vuejs/vue | https://github.com/vuejs/vue/blob/9e88707940088cb1f4cd7dd210c9168a50dc347c/types/plugin.d.ts | types/plugin.d.ts | import { Vue as _Vue } from './vue'
export type PluginFunction<T> = (Vue: typeof _Vue, options?: T) => void
export interface PluginObject<T> {
install: PluginFunction<T>
[key: string]: any
}
| typescript | MIT | 9e88707940088cb1f4cd7dd210c9168a50dc347c | 2026-01-04T15:25:31.454261Z | false |
vuejs/vue | https://github.com/vuejs/vue/blob/9e88707940088cb1f4cd7dd210c9168a50dc347c/types/vnode.d.ts | types/vnode.d.ts | import { StyleValue } from './jsx'
import { Vue } from './vue'
import { DirectiveFunction, DirectiveOptions } from './options'
import { Ref } from './v3-generated'
import { ComponentPublicInstance } from './v3-component-public-instance'
/**
* For extending allowed non-declared props on components in TSX
*/
export in... | typescript | MIT | 9e88707940088cb1f4cd7dd210c9168a50dc347c | 2026-01-04T15:25:31.454261Z | false |
vuejs/vue | https://github.com/vuejs/vue/blob/9e88707940088cb1f4cd7dd210c9168a50dc347c/types/index.d.ts | types/index.d.ts | import { Vue } from './vue'
import './umd'
import './jsx'
export * from './jsx'
export default Vue
export { CreateElement, VueConstructor } from './vue'
export {
Component,
AsyncComponent,
ComponentOptions,
FunctionalComponentOptions,
RenderContext,
PropType,
PropOptions,
ComputedOptions,
WatchHand... | typescript | MIT | 9e88707940088cb1f4cd7dd210c9168a50dc347c | 2026-01-04T15:25:31.454261Z | false |
vuejs/vue | https://github.com/vuejs/vue/blob/9e88707940088cb1f4cd7dd210c9168a50dc347c/types/v3-component-options.d.ts | types/v3-component-options.d.ts | import { Vue } from './vue'
import { VNode } from './vnode'
import { ComponentOptions as Vue2ComponentOptions } from './options'
import { EmitsOptions, SetupContext } from './v3-setup-context'
import { Data, LooseRequired, UnionToIntersection } from './common'
import {
ComponentPropsOptions,
ExtractDefaultPropTypes... | typescript | MIT | 9e88707940088cb1f4cd7dd210c9168a50dc347c | 2026-01-04T15:25:31.454261Z | false |
vuejs/vue | https://github.com/vuejs/vue/blob/9e88707940088cb1f4cd7dd210c9168a50dc347c/types/umd.d.ts | types/umd.d.ts | import * as V from './index'
import {
DefaultData,
DefaultProps,
DefaultMethods,
DefaultComputed,
PropsDefinition
} from './options'
// Expose some types for backward compatibility...
declare namespace Vue {
// vue.d.ts
export type CreateElement = V.CreateElement
export type VueConstructor<V extends Vu... | typescript | MIT | 9e88707940088cb1f4cd7dd210c9168a50dc347c | 2026-01-04T15:25:31.454261Z | false |
vuejs/vue | https://github.com/vuejs/vue/blob/9e88707940088cb1f4cd7dd210c9168a50dc347c/types/options.d.ts | types/options.d.ts | import { Vue, CreateElement, CombinedVueInstance } from './vue'
import { VNode, VNodeData, VNodeDirective, NormalizedScopedSlot } from './vnode'
import { SetupContext } from './v3-setup-context'
import { DebuggerEvent } from './v3-generated'
import { DefineComponent } from './v3-define-component'
import { ComponentOpti... | typescript | MIT | 9e88707940088cb1f4cd7dd210c9168a50dc347c | 2026-01-04T15:25:31.454261Z | false |
vuejs/vue | https://github.com/vuejs/vue/blob/9e88707940088cb1f4cd7dd210c9168a50dc347c/types/v3-define-async-component.d.ts | types/v3-define-async-component.d.ts | import { AsyncComponent, Component } from './options'
export type AsyncComponentResolveResult<T = Component> = T | { default: T } // es modules
export type AsyncComponentLoader<T = any> = () => Promise<
AsyncComponentResolveResult<T>
>
export interface AsyncComponentOptions {
loader: AsyncComponentLoader
loadi... | typescript | MIT | 9e88707940088cb1f4cd7dd210c9168a50dc347c | 2026-01-04T15:25:31.454261Z | false |
vuejs/vue | https://github.com/vuejs/vue/blob/9e88707940088cb1f4cd7dd210c9168a50dc347c/types/v3-manual-apis.d.ts | types/v3-manual-apis.d.ts | import { SetupContext } from './v3-setup-context'
import { CreateElement, Vue } from './vue'
export function getCurrentInstance(): { proxy: Vue } | null
export const h: CreateElement
export function useSlots(): SetupContext['slots']
export function useAttrs(): SetupContext['attrs']
export function useListeners(): Se... | typescript | MIT | 9e88707940088cb1f4cd7dd210c9168a50dc347c | 2026-01-04T15:25:31.454261Z | false |
vuejs/vue | https://github.com/vuejs/vue/blob/9e88707940088cb1f4cd7dd210c9168a50dc347c/types/v3-component-props.d.ts | types/v3-component-props.d.ts | import { Data, IfAny } from './common'
export type ComponentPropsOptions<P = Data> =
| ComponentObjectPropsOptions<P>
| string[]
export type ComponentObjectPropsOptions<P = Data> = {
[K in keyof P]: Prop<P[K]> | null
}
export type Prop<T, D = T> = PropOptions<T, D> | PropType<T>
type DefaultFactory<T> = () =>... | typescript | MIT | 9e88707940088cb1f4cd7dd210c9168a50dc347c | 2026-01-04T15:25:31.454261Z | false |
vuejs/vue | https://github.com/vuejs/vue/blob/9e88707940088cb1f4cd7dd210c9168a50dc347c/types/v3-setup-context.d.ts | types/v3-setup-context.d.ts | import { VNode } from './vnode'
import { Data, UnionToIntersection } from './common'
import { Vue } from './vue'
export type Slot = (...args: any[]) => VNode[]
export type Slots = Record<string, Slot | undefined>
export type ObjectEmitsOptions = Record<
string,
((...args: any[]) => any) | null
>
export type Emi... | typescript | MIT | 9e88707940088cb1f4cd7dd210c9168a50dc347c | 2026-01-04T15:25:31.454261Z | false |
vuejs/vue | https://github.com/vuejs/vue/blob/9e88707940088cb1f4cd7dd210c9168a50dc347c/types/jsx.d.ts | types/jsx.d.ts | // This code is based on react definition in DefinitelyTyped published under the MIT license.
// Repository: https://github.com/DefinitelyTyped/DefinitelyTyped
// Path in the repository: types/react/index.d.ts
//
// Copyrights of original definition are:
// AssureSign <http://www.assuresign.com>
// ... | typescript | MIT | 9e88707940088cb1f4cd7dd210c9168a50dc347c | 2026-01-04T15:25:31.454261Z | true |
vuejs/vue | https://github.com/vuejs/vue/blob/9e88707940088cb1f4cd7dd210c9168a50dc347c/types/v3-define-component.d.ts | types/v3-define-component.d.ts | import {
ComponentPropsOptions,
ExtractDefaultPropTypes,
ExtractPropTypes
} from './v3-component-props'
import {
MethodOptions,
ComputedOptions,
ComponentOptionsWithoutProps,
ComponentOptionsWithArrayProps,
ComponentOptionsWithProps,
ComponentOptionsMixin,
ComponentOptionsBase
} from './v3-component... | typescript | MIT | 9e88707940088cb1f4cd7dd210c9168a50dc347c | 2026-01-04T15:25:31.454261Z | false |
vuejs/vue | https://github.com/vuejs/vue/blob/9e88707940088cb1f4cd7dd210c9168a50dc347c/types/vue.d.ts | types/vue.d.ts | import {
Component,
AsyncComponent,
ComponentOptions,
FunctionalComponentOptions,
DirectiveOptions,
DirectiveFunction,
RecordPropsDefinition,
ThisTypedComponentOptionsWithArrayProps,
ThisTypedComponentOptionsWithRecordProps,
WatchOptions
} from './options'
import { VNode, VNodeData, VNodeChildren, N... | typescript | MIT | 9e88707940088cb1f4cd7dd210c9168a50dc347c | 2026-01-04T15:25:31.454261Z | false |
vuejs/vue | https://github.com/vuejs/vue/blob/9e88707940088cb1f4cd7dd210c9168a50dc347c/types/v3-setup-helpers.d.ts | types/v3-setup-helpers.d.ts | import { EmitFn, EmitsOptions } from './v3-setup-context'
import {
ComponentObjectPropsOptions,
ExtractPropTypes
} from './v3-component-props'
/**
* Vue `<script setup>` compiler macro for declaring component props. The
* expected argument is the same as the component `props` option.
*
* Example runtime declar... | typescript | MIT | 9e88707940088cb1f4cd7dd210c9168a50dc347c | 2026-01-04T15:25:31.454261Z | false |
vuejs/vue | https://github.com/vuejs/vue/blob/9e88707940088cb1f4cd7dd210c9168a50dc347c/types/built-in-components.d.ts | types/built-in-components.d.ts | import { DefineComponent } from './v3-define-component'
type Hook<T = () => void> = T | T[]
export interface TransitionProps {
name?: string
appear?: boolean
css?: boolean
mode?: 'in-out' | 'out-in' | 'default'
type?: 'transition' | 'animation'
duration?:
| number
| string
| {
enter: ... | typescript | MIT | 9e88707940088cb1f4cd7dd210c9168a50dc347c | 2026-01-04T15:25:31.454261Z | false |
vuejs/vue | https://github.com/vuejs/vue/blob/9e88707940088cb1f4cd7dd210c9168a50dc347c/types/v3-component-public-instance.d.ts | types/v3-component-public-instance.d.ts | import {
DebuggerEvent,
ShallowUnwrapRef,
UnwrapNestedRefs
} from './v3-generated'
import { UnionToIntersection } from './common'
import { Vue, VueConstructor } from './vue'
import {
ComputedOptions,
MethodOptions,
ExtractComputedReturns,
ComponentOptionsMixin,
ComponentOptionsBase
} from './v3-compone... | typescript | MIT | 9e88707940088cb1f4cd7dd210c9168a50dc347c | 2026-01-04T15:25:31.454261Z | false |
vuejs/vue | https://github.com/vuejs/vue/blob/9e88707940088cb1f4cd7dd210c9168a50dc347c/types/test/options-test.ts | types/test/options-test.ts | import Vue, { PropType, VNode } from '../index'
import { ComponentOptions, Component } from '../index'
import { CreateElement } from '../vue'
interface MyComponent extends Vue {
a: number
}
const option: ComponentOptions<MyComponent> = {
data() {
return {
a: 123
}
}
}
// contravariant generic sho... | typescript | MIT | 9e88707940088cb1f4cd7dd210c9168a50dc347c | 2026-01-04T15:25:31.454261Z | false |
vuejs/vue | https://github.com/vuejs/vue/blob/9e88707940088cb1f4cd7dd210c9168a50dc347c/types/test/augmentation-test.ts | types/test/augmentation-test.ts | import Vue, { defineComponent } from '../index'
declare module '../vue' {
// add instance property and method
interface Vue {
$instanceProperty: string
$instanceMethod(): void
}
// add static property and method
interface VueConstructor {
staticProperty: string
staticMethod(): void
}
}
//... | typescript | MIT | 9e88707940088cb1f4cd7dd210c9168a50dc347c | 2026-01-04T15:25:31.454261Z | false |
vuejs/vue | https://github.com/vuejs/vue/blob/9e88707940088cb1f4cd7dd210c9168a50dc347c/types/test/utils.ts | types/test/utils.ts | export declare function describe(_name: string, _fn: () => void): void
export declare function test(_name: string, _fn: () => any): void
export declare function expectType<T>(value: T): void
export declare function expectError<T>(value: T): void
export declare function expectAssignable<T, T2 extends T = T>(value: T2):... | typescript | MIT | 9e88707940088cb1f4cd7dd210c9168a50dc347c | 2026-01-04T15:25:31.454261Z | false |
vuejs/vue | https://github.com/vuejs/vue/blob/9e88707940088cb1f4cd7dd210c9168a50dc347c/types/test/setup-helpers-test.ts | types/test/setup-helpers-test.ts | import { useAttrs, useSlots, SetupContext } from '../index'
import { describe, expectType } from './utils'
describe('defineProps w/ type declaration', () => {
// type declaration
const props = defineProps<{
foo: string
}>()
// explicitly declared type should be refined
expectType<string>(props.foo)
// ... | typescript | MIT | 9e88707940088cb1f4cd7dd210c9168a50dc347c | 2026-01-04T15:25:31.454261Z | false |
vuejs/vue | https://github.com/vuejs/vue/blob/9e88707940088cb1f4cd7dd210c9168a50dc347c/types/test/async-component-test.ts | types/test/async-component-test.ts | import Vue, { AsyncComponent, Component } from '../index'
const a: AsyncComponent = () => ({
component: new Promise<Component>((res, rej) => {
res({ template: '' })
})
})
const b: AsyncComponent = () => ({
// @ts-expect-error component has to be a Promise that resolves to a component
component: () =>
... | typescript | MIT | 9e88707940088cb1f4cd7dd210c9168a50dc347c | 2026-01-04T15:25:31.454261Z | false |
vuejs/vue | https://github.com/vuejs/vue/blob/9e88707940088cb1f4cd7dd210c9168a50dc347c/types/test/umd-test.ts | types/test/umd-test.ts | const vm = new Vue({
template: '<div>hi</div>'
})
const options: Vue.ComponentOptions<Vue> = {
template: '<div>test</div>'
}
| typescript | MIT | 9e88707940088cb1f4cd7dd210c9168a50dc347c | 2026-01-04T15:25:31.454261Z | false |
vuejs/vue | https://github.com/vuejs/vue/blob/9e88707940088cb1f4cd7dd210c9168a50dc347c/types/test/plugin-test.ts | types/test/plugin-test.ts | import Vue from '../index'
import { PluginFunction, PluginObject } from '../index'
class Option {
prefix: string = ''
suffix: string = ''
}
const plugin: PluginObject<Option> = {
install(Vue, option) {
if (typeof option !== 'undefined') {
const { prefix, suffix } = option
}
}
}
const installer: ... | typescript | MIT | 9e88707940088cb1f4cd7dd210c9168a50dc347c | 2026-01-04T15:25:31.454261Z | false |
vuejs/vue | https://github.com/vuejs/vue/blob/9e88707940088cb1f4cd7dd210c9168a50dc347c/types/test/vue-test.ts | types/test/vue-test.ts | import Vue, { VNode, defineComponent } from '../index'
import { ComponentOptions } from '../options'
class Test extends Vue {
a: number = 0
testProperties() {
this.$data
this.$el
this.$options
this.$parent
this.$root
this.$children
this.$refs
this.$slots
this.$isServer
this... | typescript | MIT | 9e88707940088cb1f4cd7dd210c9168a50dc347c | 2026-01-04T15:25:31.454261Z | false |
vuejs/vue | https://github.com/vuejs/vue/blob/9e88707940088cb1f4cd7dd210c9168a50dc347c/types/test/es-module.ts | types/test/es-module.ts | export default {
data() {
return {}
}
}
| typescript | MIT | 9e88707940088cb1f4cd7dd210c9168a50dc347c | 2026-01-04T15:25:31.454261Z | false |
vuejs/vue | https://github.com/vuejs/vue/blob/9e88707940088cb1f4cd7dd210c9168a50dc347c/types/test/v3/define-async-component-test.tsx | types/test/v3/define-async-component-test.tsx | import { defineAsyncComponent } from '../../v3-define-async-component'
import { defineComponent } from '../../v3-define-component'
defineAsyncComponent(() => Promise.resolve({}))
// @ts-expect-error
defineAsyncComponent({})
defineAsyncComponent({
loader: () => Promise.resolve({}),
loadingComponent: defineCompone... | typescript | MIT | 9e88707940088cb1f4cd7dd210c9168a50dc347c | 2026-01-04T15:25:31.454261Z | false |
vuejs/vue | https://github.com/vuejs/vue/blob/9e88707940088cb1f4cd7dd210c9168a50dc347c/types/test/v3/tsx-test.tsx | types/test/v3/tsx-test.tsx | import { VNode, defineComponent, ref, RenderContext } from '../../index'
import { expectType } from '../utils'
expectType<VNode>(<div />)
expectType<JSX.Element>(<div />)
expectType<JSX.Element>(<div id="foo" />)
expectType<JSX.Element>(<input value="foo" />)
// @ts-expect-error style css property validation
expectEr... | typescript | MIT | 9e88707940088cb1f4cd7dd210c9168a50dc347c | 2026-01-04T15:25:31.454261Z | false |
vuejs/vue | https://github.com/vuejs/vue/blob/9e88707940088cb1f4cd7dd210c9168a50dc347c/types/test/v3/define-component-test.tsx | types/test/v3/define-component-test.tsx | import Vue, { VueConstructor } from '../../index'
import {
Component,
defineComponent,
PropType,
ref,
reactive,
ComponentPublicInstance
} from '../../index'
import { describe, test, expectType, expectError, IsUnion } from '../utils'
describe('compat with v2 APIs', () => {
const comp = defineComponent({})... | typescript | MIT | 9e88707940088cb1f4cd7dd210c9168a50dc347c | 2026-01-04T15:25:31.454261Z | false |
vuejs/vue | https://github.com/vuejs/vue/blob/9e88707940088cb1f4cd7dd210c9168a50dc347c/types/test/v3/watch-test.ts | types/test/v3/watch-test.ts | import { ref, computed, watch, shallowRef } from '../../index'
import { expectType } from '../utils'
const source = ref('foo')
const source2 = computed(() => source.value)
const source3 = () => 1
// lazy watcher will have consistent types for oldValue.
watch(source, (value, oldValue) => {
expectType<string>(value)
... | typescript | MIT | 9e88707940088cb1f4cd7dd210c9168a50dc347c | 2026-01-04T15:25:31.454261Z | false |
vuejs/vue | https://github.com/vuejs/vue/blob/9e88707940088cb1f4cd7dd210c9168a50dc347c/types/test/v3/inject-test.ts | types/test/v3/inject-test.ts | import { InjectionKey, provide, inject } from '../../index'
import { expectType } from '../utils'
const key: InjectionKey<number> = Symbol()
provide(key, 1)
// @ts-expect-error
provide(key, 'foo')
expectType<number | undefined>(inject(key))
expectType<number>(inject(key, 1))
expectType<number>(inject(key, () => 1, t... | typescript | MIT | 9e88707940088cb1f4cd7dd210c9168a50dc347c | 2026-01-04T15:25:31.454261Z | false |
vuejs/vue | https://github.com/vuejs/vue/blob/9e88707940088cb1f4cd7dd210c9168a50dc347c/types/test/v3/reactivity-test.ts | types/test/v3/reactivity-test.ts | import {
Ref,
ref,
shallowRef,
isRef,
unref,
reactive,
toRef,
toRefs,
ToRefs,
shallowReactive,
readonly,
markRaw,
shallowReadonly,
set,
del
} from '../../index'
import { IsUnion, describe, expectType } from '../utils'
function plainType(arg: number | Ref<number>) {
// ref coercing
con... | typescript | MIT | 9e88707940088cb1f4cd7dd210c9168a50dc347c | 2026-01-04T15:25:31.454261Z | false |
vuejs/vue | https://github.com/vuejs/vue/blob/9e88707940088cb1f4cd7dd210c9168a50dc347c/types/test/v3/setup-test.ts | types/test/v3/setup-test.ts | import Vue, { defineComponent, PropType } from '../../index'
// object props
Vue.extend({
props: {
foo: String,
bar: Number
},
setup(props) {
props.foo + 'foo'
props.bar + 123
}
})
// array props
Vue.extend({
props: ['foo', 'bar'],
setup(props) {
props.foo
props.bar
}
})
// cont... | typescript | MIT | 9e88707940088cb1f4cd7dd210c9168a50dc347c | 2026-01-04T15:25:31.454261Z | false |
vuejs/vue | https://github.com/vuejs/vue/blob/9e88707940088cb1f4cd7dd210c9168a50dc347c/compiler-sfc/index.d.ts | compiler-sfc/index.d.ts | export * from '@vue/compiler-sfc'
| typescript | MIT | 9e88707940088cb1f4cd7dd210c9168a50dc347c | 2026-01-04T15:25:31.454261Z | false |
vuejs/vue | https://github.com/vuejs/vue/blob/9e88707940088cb1f4cd7dd210c9168a50dc347c/packages/server-renderer/client-plugin.d.ts | packages/server-renderer/client-plugin.d.ts | import { WebpackPlugin } from './types/plugin'
declare const Plugin: WebpackPlugin
export = Plugin
| typescript | MIT | 9e88707940088cb1f4cd7dd210c9168a50dc347c | 2026-01-04T15:25:31.454261Z | false |
vuejs/vue | https://github.com/vuejs/vue/blob/9e88707940088cb1f4cd7dd210c9168a50dc347c/packages/server-renderer/server-plugin.d.ts | packages/server-renderer/server-plugin.d.ts | import { WebpackPlugin } from './types/plugin'
declare const Plugin: WebpackPlugin
export = Plugin
| typescript | MIT | 9e88707940088cb1f4cd7dd210c9168a50dc347c | 2026-01-04T15:25:31.454261Z | false |
vuejs/vue | https://github.com/vuejs/vue/blob/9e88707940088cb1f4cd7dd210c9168a50dc347c/packages/server-renderer/src/render.ts | packages/server-renderer/src/render.ts | import { escape } from './util'
import { SSR_ATTR } from 'shared/constants'
import { RenderContext } from './render-context'
import { resolveAsset } from 'core/util/options'
import { generateComponentTrace } from 'core/util/debug'
import { ssrCompileToFunctions } from './compiler'
import { installSSRHelpers } from './o... | typescript | MIT | 9e88707940088cb1f4cd7dd210c9168a50dc347c | 2026-01-04T15:25:31.454261Z | false |
vuejs/vue | https://github.com/vuejs/vue/blob/9e88707940088cb1f4cd7dd210c9168a50dc347c/packages/server-renderer/src/create-basic-renderer.ts | packages/server-renderer/src/create-basic-renderer.ts | import { createWriteFunction } from './write'
import { createRenderFunction } from './render'
import type { RenderOptions } from './create-renderer'
import type { Component } from 'types/component'
export function createBasicRenderer({
modules = [],
directives = {},
isUnaryTag = () => false,
cache
}: RenderOpt... | typescript | MIT | 9e88707940088cb1f4cd7dd210c9168a50dc347c | 2026-01-04T15:25:31.454261Z | false |
vuejs/vue | https://github.com/vuejs/vue/blob/9e88707940088cb1f4cd7dd210c9168a50dc347c/packages/server-renderer/src/create-renderer.ts | packages/server-renderer/src/create-renderer.ts | import RenderStream from './render-stream'
import { createWriteFunction } from './write'
import { createRenderFunction } from './render'
import { createPromiseCallback } from './util'
import TemplateRenderer from './template-renderer/index'
import type { ClientManifest } from './template-renderer/index'
import type { C... | typescript | MIT | 9e88707940088cb1f4cd7dd210c9168a50dc347c | 2026-01-04T15:25:31.454261Z | false |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.