-
-
Notifications
You must be signed in to change notification settings - Fork 94
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
16 changed files
with
129 additions
and
29 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,25 +1,4 @@ | ||
import { isObject, toHandlerKey } from '@vue/shared' | ||
import { toHandlers as _toHandlers } from '@vue/runtime-shared' | ||
import { warn } from '../warning' | ||
|
||
/** | ||
* For prefixing keys in v-on="obj" with "on" | ||
* @private | ||
*/ | ||
export function toHandlers( | ||
obj: Record<string, any>, | ||
preserveCaseIfNecessary?: boolean, | ||
): Record<string, any> { | ||
const ret: Record<string, any> = {} | ||
if (__DEV__ && !isObject(obj)) { | ||
warn(`v-on with no argument expects an object value.`) | ||
return ret | ||
} | ||
for (const key in obj) { | ||
ret[ | ||
preserveCaseIfNecessary && /[A-Z]/.test(key) | ||
? `on:${key}` | ||
: toHandlerKey(key) | ||
] = obj[key] | ||
} | ||
return ret | ||
} | ||
export const toHandlers = _toHandlers.bind(undefined, warn) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
The MIT License (MIT) | ||
|
||
Copyright (c) 2018-present, Yuxi (Evan) You | ||
|
||
Permission is hereby granted, free of charge, to any person obtaining a copy | ||
of this software and associated documentation files (the "Software"), to deal | ||
in the Software without restriction, including without limitation the rights | ||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
copies of the Software, and to permit persons to whom the Software is | ||
furnished to do so, subject to the following conditions: | ||
|
||
The above copyright notice and this permission notice shall be included in | ||
all copies or substantial portions of the Software. | ||
|
||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN | ||
THE SOFTWARE. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
# @vue/runtime-shared |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
'use strict' | ||
|
||
if (process.env.NODE_ENV === 'production') { | ||
module.exports = require('./dist/runtime-shared.cjs.prod.js') | ||
} else { | ||
module.exports = require('./dist/runtime-shared.cjs.js') | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
{ | ||
"name": "@vue/runtime-shared", | ||
"version": "3.0.0-vapor", | ||
"description": "@vue/runtime-shared", | ||
"main": "index.js", | ||
"module": "dist/runtime-shared.esm-bundler.js", | ||
"types": "dist/runtime-shared.d.ts", | ||
"files": [ | ||
"index.js", | ||
"dist" | ||
], | ||
"exports": { | ||
".": { | ||
"types": "./dist/runtime-shared.d.ts", | ||
"node": { | ||
"production": "./dist/runtime-shared.cjs.prod.js", | ||
"development": "./dist/runtime-shared.cjs.js", | ||
"default": "./index.js" | ||
}, | ||
"module": "./dist/runtime-shared.esm-bundler.js", | ||
"import": "./dist/runtime-shared.esm-bundler.js", | ||
"require": "./index.js" | ||
}, | ||
"./*": "./*" | ||
}, | ||
"sideEffects": false, | ||
"buildOptions": { | ||
"formats": [ | ||
"esm-bundler", | ||
"cjs" | ||
] | ||
}, | ||
"repository": { | ||
"type": "git", | ||
"url": "git+https://github.com/vuejs/core-vapor.git", | ||
"directory": "packages/runtime-shared" | ||
}, | ||
"keywords": [ | ||
"vue" | ||
], | ||
"author": "Evan You", | ||
"license": "MIT", | ||
"bugs": { | ||
"url": "https://github.com/vuejs/core-vapor/issues" | ||
}, | ||
"homepage": "https://github.com/vuejs/core-vapor/tree/main/packages/runtime-shared#readme" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export { toHandlers } from './toHandlers' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
import { isObject, toHandlerKey } from '@vue/shared' | ||
|
||
/** | ||
* For prefixing keys in v-on="obj" with "on" | ||
* @private | ||
*/ | ||
export function toHandlers( | ||
warn: (msg: string) => void, | ||
obj: Record<string, any>, | ||
preserveCaseIfNecessary?: boolean, | ||
): Record<string, any> { | ||
const ret: Record<string, any> = {} | ||
if (__DEV__ && !isObject(obj)) { | ||
warn(`v-on with no argument expects an object value.`) | ||
return ret | ||
} | ||
for (const key in obj) { | ||
ret[ | ||
preserveCaseIfNecessary && /[A-Z]/.test(key) | ||
? `on:${key}` | ||
: toHandlerKey(key) | ||
] = obj[key] | ||
} | ||
return ret | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
import { toHandlers as _toHandlers } from '@vue/runtime-shared' | ||
import { warn } from '../warning' | ||
|
||
export const toHandlers = _toHandlers.bind(undefined, warn) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters