Skip to content

Commit

Permalink
reorganize dev codes
Browse files Browse the repository at this point in the history
  • Loading branch information
icebob committed Jan 30, 2017
1 parent f4e5709 commit 386fa3f
Show file tree
Hide file tree
Showing 13 changed files with 72 additions and 8 deletions.
2 changes: 1 addition & 1 deletion dev/app.vue → dev/full/app.vue
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@

<script>
import Vue from "vue";
import VueFormGenerator from "../src";
import VueFormGenerator from "../../src";
import DataTable from "./dataTable.vue";
import Fakerator from "fakerator";
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion dev/dataTable.vue → dev/full/dataTable.vue
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@

<script>
import Vue from "vue";
import VueFormGenerator from "../src";
import VueFormGenerator from "../../src";
import Schema from "./schema";
import { find } from "lodash";
import { users, roles } from "./data";
Expand Down
2 changes: 1 addition & 1 deletion dev/fieldAwesome.vue → dev/full/fieldAwesome.vue
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
</template>

<script>
import VueFormGenerator from "../src";
import VueFormGenerator from "../../src";
export default {
mixins: [ VueFormGenerator.abstractField ]
Expand Down
2 changes: 1 addition & 1 deletion dev/index.html → dev/full/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,6 @@
<body>
<div class="container-fluid"></div>
<div id="app"></div>
<script src="/app.js"></script>
<script src="/full.js"></script>
</body>
</html>
File renamed without changes.
2 changes: 1 addition & 1 deletion dev/schema.js → dev/full/schema.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import moment from "moment";

import {
validators
} from "../src";
} from "../../src";

module.exports = {
fields: [
Expand Down
File renamed without changes.
42 changes: 42 additions & 0 deletions dev/multiselect/app.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
<template lang="html">
<div>
<vue-form-generator :schema="schema" :model="model" :options="formOptions"></vue-form-generator>
</div>
</template>

<script>
import Multiselect from "vue-multiselect"
window.VueMultiselect = Multiselect
export default {
components: {
Multiselect
},
data () {
return {
model: {
skills: ["Javascript", "VueJS"]
},
schema: {
fields: [
{
type: "vueMultiSelect",
multiSelect: true,
label: "Skills",
model: "skills",
values: ["Javascript", "VueJS", "CSS3", "HTML5"]
}
]
},
formOptions: {}
}
},
created() {
window.app = this;
}
}
</script>
12 changes: 12 additions & 0 deletions dev/multiselect/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>vue-form-generator multiselect demo</title>
</head>
<body>
<div class="container-fluid"></div>
<div id="app"></div>
<script src="/mselect.js"></script>
</body>
</html>
9 changes: 9 additions & 0 deletions dev/multiselect/main.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import Vue from "vue";
import VueFormGenerator from "../../src";
Vue.use(VueFormGenerator);

import App from './app.vue';

new Vue({
...App
}).$mount('#app');
2 changes: 1 addition & 1 deletion src/fields/fieldVueMultiSelect.vue
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@
created() {
// Check if the component is loaded
if (window.VueMultiselect) {
Vue.component("multiselect", window.VueMultiselect.default);
Vue.component("multiselect", window.VueMultiselect.default ? window.VueMultiselect.default : window.VueMultiselect);
} else {
console.error("'vue-multiselect' is missing. Please download from https://github.com/monterail/vue-multiselect and load the script in the HTML head section!");
}
Expand Down
5 changes: 3 additions & 2 deletions webpack.dev.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,11 @@ var loaders = [
];

module.exports = {
devtool: "eval-source-map",
devtool: "source-map",

entry: {
app: path.resolve("dev", "main.js")
full: path.resolve("dev", "full", "main.js"),
mselect: path.resolve("dev", "multiselect", "main.js")
},

output: {
Expand Down

0 comments on commit 386fa3f

Please sign in to comment.