-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(vue): add vue3 compatibly (#1138)
* feat(vue): add vue3 compatibly * feat: add .yarnrc
- Loading branch information
1 parent
a6748df
commit ac3783d
Showing
34 changed files
with
867 additions
and
849 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
registry "https://registry.yarnpkg.com" |
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,55 +1,3 @@ | ||
import vue from 'rollup-plugin-vue' | ||
import typescript from 'rollup-plugin-typescript2' | ||
import resolve from 'rollup-plugin-node-resolve' | ||
import commonjs from '@rollup/plugin-commonjs' | ||
import baseConfig from '../../scripts/rollup.base' | ||
import path from 'path' | ||
|
||
export default [ | ||
...baseConfig('formily.vue', 'Formily.Vue'), | ||
{ | ||
input: 'src/index.ts', | ||
output: { | ||
format: 'esm', | ||
file: 'esm/index.js', | ||
name: 'Formily.Vue', | ||
}, | ||
external: ['vue', '@vue/composition-api', 'mobx', '@formily/core'], | ||
plugins: [ | ||
typescript({ | ||
tsconfig: path.resolve(__dirname, 'tsconfig.json'), | ||
tsconfigOverride: { | ||
compilerOptions: { | ||
module: 'ESNext', | ||
}, | ||
}, | ||
}), | ||
vue(), | ||
resolve(), | ||
commonjs(), | ||
], | ||
}, | ||
// Browser build. | ||
{ | ||
input: 'src/index.ts', | ||
output: { | ||
format: 'cjs', | ||
file: 'lib/index.js', | ||
name: 'Formily.Vue', | ||
}, | ||
external: ['vue', '@vue/composition-api', 'mobx', '@formily/core'], | ||
plugins: [ | ||
typescript({ | ||
tsconfig: path.resolve(__dirname, 'tsconfig.json'), | ||
tsconfigOverride: { | ||
compilerOptions: { | ||
module: 'ESNext', | ||
}, | ||
}, | ||
}), | ||
vue(), | ||
resolve(), | ||
commonjs(), | ||
], | ||
}, | ||
] | ||
export default baseConfig('formily.vue', 'Formily.Vue') |
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 |
---|---|---|
@@ -0,0 +1,22 @@ | ||
import { defineObservableComponent } from '../utils/define-observable-component' | ||
import { useForm } from '../hooks' | ||
import h from '../utils/compatible-create-element' | ||
|
||
export default defineObservableComponent({ | ||
name: 'FormConsumer', | ||
observableSetup(collect, props, { attrs, slots }) { | ||
const form = useForm() | ||
collect({ | ||
form | ||
}) | ||
return () => h( | ||
'div', | ||
{ attrs }, | ||
{ | ||
default: () => slots.default && slots.default({ | ||
form | ||
}) | ||
} | ||
) | ||
} | ||
}) |
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.