339 matches across 25 files for func main
snippet_mode: auto · sorted by relevance
packages/compiler-sfc/src/babelUtils.ts TYPESCRIPT 25 matches · showing 5 view file →
1// https://github.com/vuejs/core/blob/main/packages/compiler-core/src/babelUtils.ts
2
3// should only use types from @babel/types
· · ·
6 Identifier,
7 Node,
8 Function,
9 ObjectProperty,
10 BlockStatement,
· · ·
13import { walk } from 'estree-walker'
14
15export function walkIdentifiers(
16 root: Node,
17 onIdentifier: (
· · ·
60 // mark property in destructure pattern
61 ;(node as any).inPattern = true
62 } else if (isFunctionType(node)) {
63 // walk function expressions and add its arguments to known identifiers
64 // so that we don't prefix them
· · ·
63 // walk function expressions and add its arguments to known identifiers
64 // so that we don't prefix them
65 walkFunctionParams(node, id => markScopeIdentifier(node, id, knownIds))
+ 20 more matches in this file
packages/compiler-sfc/src/compileScript.ts TYPESCRIPT 64 matches · showing 5 view file →
1import MagicString from 'magic-string'
2import LRU from 'lru-cache'
3import { walkIdentifiers, isFunctionType } from './babelUtils'
4import { BindingMetadata, BindingTypes } from './types'
5import { SFCDescriptor, SFCScriptBlock } from './parseComponent'
· · ·
24 TSType,
25 TSTypeLiteral,
26 TSFunctionType,
27 ObjectProperty,
28 ArrayExpression,
· · ·
96 * normal `<script>` + `<script setup>` if both are present.
97 */
98export function compileScript(
99 sfc: SFCDescriptor,
100 options: SFCScriptCompileOptions = { id: '' }
· · ·
208 let emitsRuntimeDecl: Node | undefined
209 let emitsTypeDecl:
210 | TSFunctionType
211 | TSTypeLiteral
212 | TSInterfaceBody
· · ·
236 const scriptEndOffset = script && script.end
237
238 function helper(key: string): string {
239 helperImports.add(key)
240 return `_${key}`
+ 59 more matches in this file
src/compiler/parser/html-parser.ts TYPESCRIPT 8 matches · showing 5 view file →
51 tag && isIgnoreNewlineTag(tag) && html[0] === '\n'
52
53function decodeAttr(value, shouldDecodeNewlines) {
54 const re = shouldDecodeNewlines ? encodedAttrWithNewLines : encodedAttr
55 return value.replace(re, match => decodingMap[match])
· · ·
69}
70
71export function parseHTML(html, options: HTMLParserOptions) {
72 const stack: any[] = []
73 const expectHTML = options.expectHTML
· · ·
174 'i'
175 ))
176 const rest = html.replace(reStackedTag, function (all, text, endTag) {
177 endTagLength = endTag.length
178 if (!isPlainTextElement(stackedTag) && stackedTag !== 'noscript') {
· · ·
205 }
206
207 // Clean up any remaining tags
208 parseEndTag()
209
· · ·
210 function advance(n) {
211 index += n
212 html = html.substring(n)
+ 3 more matches in this file
scripts/release.js JAVASCRIPT 4 matches view file →
34const step = msg => console.log(chalk.cyan(msg))
35
36async function main() {
37 let targetVersion = args._[0]
38
· · ·
132}
133
134function updatePackage(pkgRoot, version) {
135 const pkgPath = path.resolve(pkgRoot, 'package.json')
136 const pkg = JSON.parse(fs.readFileSync(pkgPath, 'utf-8'))
· · ·
144 : path.resolve(__dirname, '../packages/' + pkg)
145
146async function publishPackage(pkgName, version, runIfNotDry) {
147 const pkgRoot = getPkgRoot(pkgName)
148 const pkgPath = path.resolve(pkgRoot, 'package.json')
· · ·
200}
201
202main()
203
src/platforms/web/runtime/components/transition-group.ts TYPESCRIPT 7 matches · showing 5 view file →
8// triggering their leaving transition; in the second pass, we insert/move
9// into the final desired state. This way in the second pass removed
10// nodes will remain where they should be.
11
12import { warn, extend } from 'core/util/index'
· · ·
56 },
57
58 render(h: Function) {
59 const tag: string = this.tag || this.$vnode.data.tag || 'span'
60 const map: Record<string, any> = Object.create(null)
· · ·
128 el.addEventListener(
129 transitionEndEvent,
130 (el._moveCb = function cb(e) {
131 if (e && e.target !== el) {
132 return
· · ·
174}
175
176function callPendingCbs(
177 c: VNodeWithData & { elm?: { _moveCb?: Function; _enterCb?: Function } }
178) {
· · ·
177 c: VNodeWithData & { elm?: { _moveCb?: Function; _enterCb?: Function } }
178) {
179 /* istanbul ignore if */
+ 2 more matches in this file
packages/compiler-sfc/src/compileTemplate.ts TYPESCRIPT 12 matches · showing 5 view file →
21 transpileOptions?: any
22 isProduction?: boolean
23 isFunctional?: boolean
24 optimizeSSR?: boolean
25 prettify?: boolean
· · ·
36}
37
38export function compileTemplate(
39 options: SFCTemplateCompileOptions
40): SFCTemplateCompileResults {
· · ·
50 return {
51 ast: {},
52 code: `var render = function () {}\n` + `var staticRenderFns = []\n`,
53 source: options.source,
54 tips: [
· · ·
64}
65
66function preprocess(
67 options: SFCTemplateCompileOptions,
68 preprocessor: any
· · ·
95}
96
97function actuallyCompile(
98 options: SFCTemplateCompileOptions
99): SFCTemplateCompileResults {
+ 7 more matches in this file
examples/classic/todomvc/app.js JAVASCRIPT 24 matches · showing 5 view file →
5var STORAGE_KEY = 'todos-vuejs-2.0'
6var todoStorage = {
7 fetch: function () {
8 var todos = JSON.parse(localStorage.getItem(STORAGE_KEY) || '[]')
9 todos.forEach(function (todo, index) {
· · ·
9 todos.forEach(function (todo, index) {
10 todo.id = index
11 })
· · ·
13 return todos
14 },
15 save: function (todos) {
16 localStorage.setItem(STORAGE_KEY, JSON.stringify(todos))
17 }
· · ·
20// visibility filters
21var filters = {
22 all: function (todos) {
23 return todos
24 },
· · ·
25 active: function (todos) {
26 return todos.filter(function (todo) {
27 return !todo.completed
+ 19 more matches in this file
src/platforms/web/util/element.ts TYPESCRIPT 3 matches view file →
10 'html,body,base,head,link,meta,style,title,' +
11 'address,article,aside,footer,header,h1,h2,h3,h4,h5,h6,hgroup,nav,section,' +
12 'div,dd,dl,dt,figcaption,figure,picture,hr,img,li,main,ol,p,pre,ul,' +
13 'a,b,abbr,bdi,bdo,br,cite,code,data,dfn,em,i,kbd,mark,q,rp,rt,rtc,ruby,' +
14 's,samp,small,span,strong,sub,sup,time,u,var,wbr,area,audio,map,track,video,' +
· · ·
36}
37
38export function getTagNamespace(tag: string): string | undefined {
39 if (isSVG(tag)) {
40 return 'svg'
· · ·
48
49const unknownElementCache = Object.create(null)
50export function isUnknownElement(tag: string): boolean {
51 /* istanbul ignore if */
52 if (!inBrowser) {
src/platforms/web/compiler/modules/model.ts TYPESCRIPT 3 matches view file →
19import { ASTElement, CompilerOptions, ModuleOptions } from 'types/compiler'
20
21function preTransformNode(el: ASTElement, options: CompilerOptions) {
22 if (el.tag === 'input') {
23 const map = el.attrsMap
· · ·
41 // 1. checkbox
42 const branch0 = cloneASTElement(el)
43 // process for on the main node
44 processFor(branch0)
45 addRawAttr(branch0, 'type', 'checkbox')
· · ·
81}
82
83function cloneASTElement(el) {
84 return createASTElement(el.tag, el.attrsList.slice(), el.parent)
85}
test/unit/modules/vdom/patch/children.spec.ts TYPESCRIPT 12 matches · showing 5 view file →
2import VNode, { createEmptyVNode } from 'core/vdom/vnode'
3
4function prop(name) {
5 return obj => {
6 return obj[name]
· · ·
8}
9
10function map(fn, list) {
11 const ret: any[] = []
12 for (let i = 0; i < list.length; i++) {
· · ·
16}
17
18function spanNum(n) {
19 if (typeof n === 'string') {
20 return new VNode('span', {}, undefined, n)
· · ·
24}
25
26function shuffle(array) {
27 let currentIndex = array.length
28 let temporaryValue
· · ·
29 let randomIndex
30
31 // while there remain elements to shuffle...
32 while (currentIndex !== 0) {
33 // pick a remaining element...
+ 7 more matches in this file
packages/server-renderer/test/ssr-template.spec.ts TYPESCRIPT 9 matches · showing 5 view file →
13const interpolateTemplate = `<html><head><title>{{ title }}</title></head><body><!--vue-ssr-outlet-->{{{ snippet }}}</body></html>`
14
15async function generateClientManifest(file: string) {
16 const fs = await compileWithWebpack(file, {
17 output: {
· · ·
30}
31
32async function createRendererWithManifest(
33 file: string,
34 options?: RenderOptions
· · ·
143 })
144
145 it('renderToString w/ template function', async () => {
146 const renderer = createRenderer({
147 template: (content, context) =>
· · ·
165 })
166
167 it('renderToString w/ template function returning Promise', async () => {
168 const renderer = createRenderer({
169 template: (content, context) =>
· · ·
191 })
192
193 it('renderToString w/ template function returning Promise w/ rejection', async () => {
194 const renderer = createRenderer({
195 template: () =>
+ 4 more matches in this file
examples/classic/firebase/app.js JAVASCRIPT 6 matches · showing 5 view file →
4var config = {
5 apiKey: "AIzaSyAi_yuJciPXLFr_PYPeU3eTvtXf8jbJ8zw",
6 authDomain: "vue-demo-537e6.firebaseapp.com",
7 databaseURL: "https://vue-demo-537e6.firebaseio.com"
8}
· · ·
29 // computed property for form validation state
30 computed: {
31 validation: function () {
32 return {
33 name: !!this.newUser.name.trim(),
· · ·
35 }
36 },
37 isValid: function () {
38 var validation = this.validation
39 return Object.keys(validation).every(function (key) {
· · ·
39 return Object.keys(validation).every(function (key) {
40 return validation[key]
41 })
· · ·
44 // methods
45 methods: {
46 addUser: function () {
47 if (this.isValid) {
48 usersRef.push(this.newUser)
+ 1 more matches in this file
test/e2e/commits.spec.ts TYPESCRIPT 5 matches view file →
6 const { page, click, count, text, isChecked } = setupPuppeteer()
7
8 async function testCommits(apiType: 'classic' | 'composition') {
9 // intercept and mock the response to avoid hitting the actual API
10 await page().setRequestInterception(true)
· · ·
14 req.continue()
15 } else {
16 const ret = JSON.stringify(mocks[match[1] as 'main' | 'dev'])
17 req.respond({
18 status: 200,
· · ·
29 expect(await count('input')).toBe(2)
30 expect(await count('label')).toBe(2)
31 expect(await text('label[for="main"]')).toBe('main')
32 expect(await text('label[for="dev"]')).toBe('dev')
33 expect(await isChecked('#main')).toBe(true)
· · ·
33 expect(await isChecked('#main')).toBe(true)
34 expect(await isChecked('#dev')).toBe(false)
35 expect(await text('p')).toBe('vuejs/vue@main')
· · ·
35 expect(await text('p')).toBe('vuejs/vue@main')
36 expect(await count('li')).toBe(3)
37 expect(await count('li .commit')).toBe(3)
test/unit/modules/compiler/parser.spec.ts TYPESCRIPT 5 matches view file →
866 })
867
868 it('preserve whitespace in <pre> tag', function () {
869 const options = extend({}, baseOptions)
870 const ast = parse(
· · ·
884
885 // #5992
886 it('ignore the first newline in <pre> tag', function () {
887 const options = extend({}, baseOptions)
888 const ast = parse(
· · ·
1072 })
1073
1074 it(`maintains &nbsp; with whitespace: 'condense'`, () => {
1075 const options = extend({}, condenseOptions)
1076 const ast = parse('<span>&nbsp;</span>', options)
· · ·
1080 })
1081
1082 it(`preserve whitespace in <pre> tag with whitespace: 'condense'`, function () {
1083 const options = extend({}, condenseOptions)
1084 const ast = parse(
· · ·
1097 })
1098
1099 it(`ignore the first newline in <pre> tag with whitespace: 'condense'`, function () {
1100 const options = extend({}, condenseOptions)
1101 const ast = parse(
examples/classic/commits/app.js JAVASCRIPT 7 matches · showing 5 view file →
9
10 data: {
11 branches: ['main', 'dev'],
12 currentBranch: 'main',
13 commits: null
· · ·
12 currentBranch: 'main',
13 commits: null
14 },
· · ·
15
16 created: function () {
17 this.fetchData()
18 },
· · ·
23
24 filters: {
25 truncate: function (v) {
26 var newline = v.indexOf('\n')
27 return newline > 0 ? v.slice(0, newline) : v
· · ·
28 },
29 formatDate: function (v) {
30 return v.replace(/T|Z/g, ' ')
31 }
+ 2 more matches in this file
examples/composition/todomvc.html HTML 19 matches · showing 5 view file →
18 />
19 </header>
20 <section class="main" v-show="state.todos.length">
21 <input
22 id="toggle-all"
· · ·
52 <footer class="footer" v-show="state.todos.length">
53 <span class="todo-count">
54 <strong>{{ state.remaining }}</strong>
55 <span>{{ state.remainingText }}</span>
56 </span>
· · ·
55 <span>{{ state.remainingText }}</span>
56 </span>
57 <ul class="filters">
· · ·
80 class="clear-completed"
81 @click="removeCompleted"
82 v-show="state.todos.length > state.remaining"
83 >
84 Clear completed
· · ·
116 },
117 completed(todos) {
118 return todos.filter(function (todo) {
119 return todo.completed
120 })
+ 14 more matches in this file
packages/template-compiler/README.md MARKDOWN 15 matches · showing 5 view file →
3> This package is auto-generated. For pull requests please see [src/platforms/web/entry-compiler.js](https://github.com/vuejs/vue/tree/dev/src/platforms/web/entry-compiler.js).
4
5This package can be used to pre-compile Vue 2.0 templates into render functions to avoid runtime-compilation overhead and CSP restrictions. In most cases you should be using it with [`vue-loader`](https://github.com/vuejs/vue-loader), you will only need it separately if you are writing build tools with very specific needs.
6
7## Installation
· · ·
24{
25 ast: ?ASTElement, // parsed template elements to AST
26 render: string, // main render function code
27 staticRenderFns: Array<string>, // render code for static sub trees, if any
28 errors: Array<string> // template syntax errors, if any
· · ·
30```
31
32Note the returned function code uses `with` and thus cannot be used in strict mode code.
33
34#### Options
· · ·
86- `directives`
87
88 An object where the key is the directive name and the value is a function that transforms an template AST node. For example:
89
90 ``` js
· · ·
98 ```
99
100 By default, a compile-time directive will extract the directive and the directive will not be present at runtime. If you want the directive to also be handled by a runtime definition, return `true` in the transform function.
101
102 Refer to the implementation of some [built-in compile-time directives](https://github.com/vuejs/vue/tree/dev/src/platforms/web/compiler/directives).
+ 10 more matches in this file
.github/CONTRIBUTING.md MARKDOWN 5 matches view file →
90- **`packages`**:
91
92 - `vue-server-renderer` and `vue-template-compiler` are distributed as separate NPM packages. They are automatically generated from the source code and always have the same version with the main `vue` package.
93
94 - `compiler-sfc` is an internal package that is distributed as part of the main `vue` package. It's aliased and can be imported as `vue/compiler-sfc` similar to Vue 3.
· · ·
94 - `compiler-sfc` is an internal package that is distributed as part of the main `vue` package. It's aliased and can be imported as `vue/compiler-sfc` similar to Vue 3.
95
96- **`test`**: contains all tests. The unit tests are written with [Jasmine](http://jasmine.github.io/2.3/introduction.html) and run with [Karma](http://karma-runner.github.io/0.13/index.html). The e2e tests are written for and run with [Nightwatch.js](http://nightwatchjs.org/).
· · ·
98- **`src`**: contains the source code. The codebase is written in ES2015 with [Flow](https://flowtype.org/) type annotations.
99
100 - **`compiler`**: contains code for the template-to-render-function compiler.
101
102 The compiler consists of a parser (converts template strings to element ASTs), an optimizer (detects static trees for vdom render optimization), and a code generator (generate render function code from element ASTs). Note that codegen directly generates code strings from the element AST - it's done this way for smaller code size because the compiler is shipped to the browser in the standalone build.
· · ·
102 The compiler consists of a parser (converts template strings to element ASTs), an optimizer (detects static trees for vdom render optimization), and a code generator (generate render function code from element ASTs). Note that codegen directly generates code strings from the element AST - it's done this way for smaller code size because the compiler is shipped to the browser in the standalone build.
103
104 - **`core`**: contains universal, platform-agnostic runtime code.
· · ·
122 Entry files for dist builds are located in their respective platform directory.
123
124 Each platform module contains three parts: `compiler`, `runtime` and `server`, corresponding to the three directories above. Each part contains platform-specific modules/utilities which are imported and injected to the core counterparts in platform-specific entry files. For example, the code implementing the logic behind `v-bind:class` is in `platforms/web/runtime/modules/class.js` - which is imported in `platforms/web/entry-runtime.ts` and used to create the browser-specific vdom patching function.
125
126 - **`sfc`**: contains single-file component (`*.vue` files) parsing logic. This is used in the `vue-template-compiler` package.
types/jsx.d.ts TYPESCRIPT TYPINGS 7 matches · showing 5 view file →
99 'aria-disabled'?: Booleanish
100 /**
101 * Indicates what functions can be performed when a dragged object is released on the drop target.
102 * @deprecated in ARIA 1.1
103 */
· · ·
157 'aria-orientation'?: 'horizontal' | 'vertical'
158 /**
159 * Identifies an element (or elements) in order to define a visual, functional, or contextual parent/child relationship
160 * between DOM elements where the DOM hierarchy cannot be used to represent the relationship.
161 * @see aria-controls.
· · ·
1064 li: LiHTMLAttributes
1065 link: LinkHTMLAttributes
1066 main: HTMLAttributes
1067 map: MapHTMLAttributes
1068 mark: HTMLAttributes
· · ·
1140 feDropShadow: SVGAttributes
1141 feFlood: SVGAttributes
1142 feFuncA: SVGAttributes
1143 feFuncB: SVGAttributes
1144 feFuncG: SVGAttributes
· · ·
1143 feFuncB: SVGAttributes
1144 feFuncG: SVGAttributes
1145 feFuncR: SVGAttributes
+ 2 more matches in this file
CHANGELOG.md MARKDOWN 35 matches · showing 5 view file →
101* **sfc:** remove sfc scoped deep syntax deprecation warnings ([2f335b2](https://github.com/vuejs/vue/commit/2f335b2f9d09b962f40e38740826d444e4fff073))
102* **types:** fix error with options watch ([#12779](https://github.com/vuejs/vue/issues/12779)) ([bc5b92a](https://github.com/vuejs/vue/commit/bc5b92adde147436f2adb25e457f0c967829467f)), closes [#12780](https://github.com/vuejs/vue/issues/12780)
103* **types:** support Ref and function types in tsx ref attribute ([#12759](https://github.com/vuejs/vue/issues/12759)) ([87f69aa](https://github.com/vuejs/vue/commit/87f69aa26f195390b948fbb0ff62cf954b58c82c)), closes [#12758](https://github.com/vuejs/vue/issues/12758)
104* **types:** vue 3 directive type compatibility ([#12792](https://github.com/vuejs/vue/issues/12792)) ([27eed82](https://github.com/vuejs/vue/commit/27eed829ccf9978a63b8cd989ff4c03897276bc2))
105
· · ·
211* **build:** fix mjs dual package hazard ([012e10c](https://github.com/vuejs/vue/commit/012e10c9ca13fcbc9bf67bf2835883edcd4faace)), closes [#12626](https://github.com/vuejs/vue/issues/12626)
212* **compiler-sfc:** use safer deindent default for compatibility with previous behavior ([b70a258](https://github.com/vuejs/vue/commit/b70a2585fcd102def2bb5a3b2b589edf5311122d))
213* pass element creation helper to static render fns for functional components ([dc8a68e](https://github.com/vuejs/vue/commit/dc8a68e8c6c4e8ed4fdde094004fca272d71ef2e)), closes [#12625](https://github.com/vuejs/vue/issues/12625)
214* **ssr/reactivity:** fix array setting error at created in ssr [[#12632](https://github.com/vuejs/vue/issues/12632)] ([#12633](https://github.com/vuejs/vue/issues/12633)) ([ca7daef](https://github.com/vuejs/vue/commit/ca7daefaa15a192046d22d060220cd595a6a275f))
215* **types:** fix missing instance properties on defineComponent this ([f8de4ca](https://github.com/vuejs/vue/commit/f8de4ca9d458a03378e848b1e62d6507f7124871)), closes [#12628](https://github.com/vuejs/vue/issues/12628#issuecomment-1177258223)
· · ·
223
224* defineAsyncComponent ([9d12106](https://github.com/vuejs/vue/commit/9d12106e211e0cbf33f9066606a8ff29f8cc8e8d)), closes [#12608](https://github.com/vuejs/vue/issues/12608)
225* support functional components in defineComponent ([559600f](https://github.com/vuejs/vue/commit/559600f13d312915c0a1b54ed4edd41327dbedd6)), closes [#12619](https://github.com/vuejs/vue/issues/12619)
226
227
· · ·
280- The `emits` option is also supported, but only for type-checking purposes (does not affect runtime behavior)
281
282 2.7 also supports using ESNext syntax in template expressions. When using a build system, the compiled template render function will go through the same loaders / plugins configured for normal JavaScript. This means if you have configured Babel for `.js` files, it will also apply to the expressions in your SFC templates.
283
284### Notes on API exposure
· · ·
634- **compiler:** event handlers with modifiers swallowing arguments (fix [#10867](https://github.com/vuejs/vue/issues/10867)) ([#10958](https://github.com/vuejs/vue/issues/10958)) ([8620706](https://github.com/vuejs/vue/commit/862070662dd4871cb834664435ec836df57c7d57))
635- **core:** fix sameVnode for async component ([#11107](https://github.com/vuejs/vue/issues/11107)) ([5260830](https://github.com/vuejs/vue/commit/52608302e9bca84fb9e9f0499e89acade78d3d07))
636- **core:** remove trailing comma in function signature ([#10845](https://github.com/vuejs/vue/issues/10845)) ([579e1ff](https://github.com/vuejs/vue/commit/579e1ff9df1d454f85fac386d098b7bf1a42c4f2)), closes [#10843](https://github.com/vuejs/vue/issues/10843)
637- **errorHandler:** async error handling for watchers ([#9484](https://github.com/vuejs/vue/issues/9484)) ([e4dea59](https://github.com/vuejs/vue/commit/e4dea59f84dfbf32cda1cdd832380dd90b1a6fd1))
638- force update between two components with and without slot ([#11795](https://github.com/vuejs/vue/issues/11795)) ([77b5330](https://github.com/vuejs/vue/commit/77b5330c5498a6b14a83197371e9a2dbf9939a9c))
+ 30 more matches in this file
packages/compiler-sfc/test/rewriteDefault.spec.ts TYPESCRIPT 6 matches · showing 5 view file →
49 test('export named default multiline', () => {
50 expect(
51 rewriteDefault(`let App = {}\n export {\nApp as default\n}`, '_sfc_main')
52 ).toMatchInlineSnapshot(`
53 "let App = {}
· · ·
55
56 }
57 const _sfc_main = App"
58 `)
59 })
· · ·
63 rewriteDefault(
64 `const a = 1 \n export {\n a as b,\n a as default,\n a as c}\n` +
65 `// export { myFunction as default }`,
66 'script'
67 )
· · ·
72
73 a as c}
74 // export { myFunction as default }
75 const script = a"
76 `)
· · ·
79 rewriteDefault(
80 `const a = 1 \n export {\n a as b,\n a as default ,\n a as c}\n` +
81 `// export { myFunction as default }`,
82 'script'
83 )
+ 1 more matches in this file
test/e2e/todomvc.spec.ts TYPESCRIPT 4 matches view file →
16 } = setupPuppeteer()
17
18 async function removeItemAt(n: number) {
19 const item = (await page().$('.todo:nth-child(' + n + ')'))!
20 const itemBBox = (await item.boundingBox())!
· · ·
23 }
24
25 async function testTodomvc(apiType: 'classic' | 'composition') {
26 const baseUrl = getExampleUrl('todomvc', apiType)
27 await page().goto(baseUrl)
· · ·
28 expect(await isVisible('.main')).toBe(false)
29 expect(await isVisible('.footer')).toBe(false)
30 expect(await count('.filters .selected')).toBe(1)
· · ·
38 expect(await text('.todo-count strong')).toBe('1')
39 expect(await isChecked('.todo .toggle')).toBe(false)
40 expect(await isVisible('.main')).toBe(true)
41 expect(await isVisible('.footer')).toBe(true)
42 expect(await isVisible('.clear-completed')).toBe(false)
pnpm-lock.yaml YAML 16 matches · showing 5 view file →
1658 resolution: {integrity: sha512-C3nQxfFZxFRVoJoGKKI8y3MOEo129NQ+FgQ08iye+Mk4zNZZGdjfs06bVTr+DBSlA66Q2VEcMki/cUCP4SercQ==}
1659 dependencies:
1660 function-bind: 1.1.2
1661 get-intrinsic: 1.2.2
1662 set-function-length: 1.1.1
· · ·
1662 set-function-length: 1.1.1
1663 dev: true
1664
· · ·
1684 check-error: 1.0.3
1685 deep-eql: 4.1.3
1686 get-func-name: 2.0.2
1687 loupe: 2.3.7
1688 pathval: 1.1.1
· · ·
1715 resolution: {integrity: sha512-iKEoDYaRmd1mxM90a2OEfWhjsjPpYPuQ+lMYsoxB126+t8fw7ySEO48nmDg5COTjxDI65/Y2OWpeEHk3ZOe8zg==}
1716 dependencies:
1717 get-func-name: 2.0.2
1718 dev: true
1719
· · ·
1878 dev: true
1879
1880 /compare-func@2.0.0:
1881 resolution: {integrity: sha512-zHig5N+tPWARooBnb0Zx1MFcdfpyJrfTJ3Y5L+IFvUm8rM74hHz66z0gw0x4tijh5CorKkKUCnW82R2vmpeCRA==}
1882 dependencies:
+ 11 more matches in this file
packages/compiler-sfc/test/__snapshots__/compileScript.spec.ts.snap 12 matches · showing 5 view file →
313
314 const a = 1
315 function b() {}
316
317return { a, b, Baz }
· · ·
530 let aa = 1
531 const bb = 2
532 function cc() {}
533 class dd {}
534
· · ·
540 let a = 1
541 const b = 2
542 function c() {}
543 class d {}
544
· · ·
627`;
628
629exports[`SFC compile <script setup> > with TypeScript > defineEmits w/ type (referenced exported function type) 1`] = `
630"import { defineComponent as _defineComponent } from 'vue'
631export type Emits = (e: 'foo' | 'bar') => void
· · ·
643`;
644
645exports[`SFC compile <script setup> > with TypeScript > defineEmits w/ type (referenced function type) 1`] = `
646"import { defineComponent as _defineComponent } from 'vue'
647type Emits = (e: 'foo' | 'bar') => void
+ 7 more matches in this file
test/unit/features/component/component-keep-alive.spec.ts TYPESCRIPT 9 matches · showing 5 view file →
28 })
29
30 function assertHookCalls(component, callCounts) {
31 expect([
32 component.created.mock.calls.length,
· · ·
227 expect(vm.$el.textContent).toBe('')
228 assertHookCalls(one, [1, 1, 4, 3, 0])
229 assertHookCalls(two, [1, 1, 4, 4, 0]) // should remain inactive
230 })
231 .then(done)
· · ·
232 })
233
234 function sharedAssertions(vm, done) {
235 expect(vm.$el.textContent).toBe('one')
236 assertHookCalls(one, [1, 1, 1, 0, 0])
· · ·
550 const spyCD = vi.fn()
551
552 function assertCount(calls) {
553 expect([
554 spyA.mock.calls.length,
· · ·
620 const spyCD = vi.fn()
621
622 function assertCount(calls) {
623 expect([
624 spyA.mock.calls.length,
+ 4 more matches in this file
Search syntax
auth loginboth terms (AND is implicit)
auth OR logineither term
NOT path:vendorexclude matches
"exact phrase"quoted exact match
/func\s+Test/regex
handler~1fuzzy (Levenshtein 1)
file:*_test.gofilename glob
path:pkg/auth/**full path glob
lang:golanguage filter

Search any public repo from your terminal

This page calls POST /api/v1/code_search. Same tool, available over MCP for Claude/Cursor/Copilot.