8000 fix: npm 3 not install peerDependencies & typo · 0x0xy/vue-function-api@e2d5933 · GitHub
[go: up one dir, main page]

Skip to content

Commit e2d5933

Browse files
Jia ChenJia Chen
Jia Chen
authored and
Jia Chen
committed
fix: npm 3 not install peerDependencies & typo
1 parent 88b5c36 commit e2d5933

File tree

4 files changed

+6
-4380
lines changed

4 files changed

+6
-4380
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,6 @@ package-lock.json
55
dist
66
lib
77
.vscode
8+
.idea
89
.rpt2_cache
910
TODO.md

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,8 @@
4040
"rollup-plugin-replace": "^2.2.0",
4141
"rollup-plugin-terser": "^4.0.4",
4242
"rollup-plugin-typescript2": "^0.21.0",
43-
"typescript": "^3.4.5"
43+
"typescript": "^3.4.5",
44+
"vue": "^2.6.10"
4445
},
4546
"peerDependencies": {
4647
"vue": "^2.0.0"

src/setup.ts

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,13 @@ import { value } from './functions/state';
77

88
export function mixin(Vue: VueConstructor) {
99
Vue.mixin({
10-
created: vuexInit,
10+
created: functionApiInit,
1111
});
1212

1313
/**
1414
* Vuex init hook, injected into each instances init hooks list.
1515
*/
16-
function vuexInit(this: any) {
16+
function functionApiInit(this: any) {
1717
const vm = this;
1818
const { setup } = vm.$options;
1919
if (!setup) {
@@ -58,8 +58,7 @@ export function mixin(Vue: VueConstructor) {
5858

5959
Object.keys(binding).forEach(name => {
6060
let bindingValue = binding[name];
61-
if (bindingValue === undefined)
62-
return;
61+
if (bindingValue === undefined) return;
6362
// make plain value reactive
6463
if (!isWrapper(bindingValue) && !isFunction(bindingValue) && !Object.isFrozen(bindingValue)) {
6564
bindingValue = value(bindingValue);

0 commit comments

Comments
 (0)
0