Skip to content

Commit 58e3d97

Browse files
committed
trying to fix broken vue dep
1 parent fdcca90 commit 58e3d97

File tree

8 files changed

+24
-10101
lines changed

8 files changed

+24
-10101
lines changed

dist/1.vue-formly.js

Lines changed: 4 additions & 10084 deletions
Large diffs are not rendered by default.

dist/1.vue-formly.min.js

Lines changed: 1 addition & 8 deletions
Large diffs are not rendered by default.

dist/vue-formly.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,9 @@ return /******/ (function(modules) { // webpackBootstrap
127127
addType: function addType(id, options) {
128128
Vue.$formlyFields[id] = options;
129129
},
130+
getTypes: function getTypes() {
131+
return Vue.$formlyFields;
132+
},
130133
install: function install(Vue, options) {
131134

132135
if (Formly.installed) {
@@ -141,6 +144,8 @@ return /******/ (function(modules) { // webpackBootstrap
141144

142145
if (typeof window !== 'undefined' && window.Vue) {
143146
window.Vue.use(Formly);
147+
148+
window.Vue.$formly = Formly;
144149
}
145150
exports.default = Formly;
146151

dist/vue-formly.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,7 @@
22
"name": "vue-formly",
33
"version": "0.1.0",
44
"description": "A simple and extendable form builder for Vue.js",
5-
"main": "dist/vue-formly.common.js",
6-
"jsnext:main": "dist/vue-formly.es2015.js",
5+
"main": "dist/vue-formly.js",
76
"scripts": {
87
"test": "karma start test/unit/karma.conf.js",
98
"build": "webpack --config webpack.build.config.js"

src/components/FormlyField.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@
33
</template>
44

55
<script>
6-
import Vue from 'vue';
6+
import VueFormly from '../index';
77
export default {
88
props: ['field', 'model'],
9-
components: Vue.$formlyFields
9+
components: VueFormly.getTypes()
1010
}
1111
</script>

src/index.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,10 @@ let Formly = {
1010
addType(id, options){
1111
Vue.$formlyFields[id] = options;
1212
},
13+
14+
getTypes(){
15+
return Vue.$formlyFields;
16+
},
1317

1418
install(Vue, options){
1519

@@ -27,5 +31,7 @@ let Formly = {
2731
//auto install
2832
if (typeof window !== 'undefined' && window.Vue) {
2933
window.Vue.use(Formly);
34+
//expose formly functions if auto installed
35+
window.Vue.$formly = Formly;
3036
}
3137
export default Formly;

test/unit/specs/FormlyForm.spec.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,6 @@ let FormlyRestrictedField = Vue.extend({
1919
props: ['field', 'model']
2020
});
2121

22-
Vue.$formlyFields = {
23-
'restricted': FormlyRestrictedField
24-
};
25-
2622

2723
let el, vm;
2824

@@ -87,6 +83,10 @@ describe('FormlyForm', () => {
8783
});
8884
});
8985

86+
Vue.$formlyFields = {
87+
'restricted': FormlyRestrictedField
88+
};
89+
9090
let data = {
9191
schema: [
9292
{

0 commit comments

Comments
 (0)