From 80e0f86f36367c96c9ed293d6238f363a51032f7 Mon Sep 17 00:00:00 2001 From: Icebob Date: Thu, 28 Apr 2016 22:03:58 +0200 Subject: [PATCH] Dev environment --- dev/app.vue | 117 ++++++++++++++++++++++++++++++++++++++++++ dev/index.html | 29 +---------- dev/main.js | 77 ++------------------------- package.json | 1 - webpack.dev.config.js | 4 -- 5 files changed, 123 insertions(+), 105 deletions(-) create mode 100644 dev/app.vue diff --git a/dev/app.vue b/dev/app.vue new file mode 100644 index 00000000..5445bbb8 --- /dev/null +++ b/dev/app.vue @@ -0,0 +1,117 @@ + + + + + \ No newline at end of file diff --git a/dev/index.html b/dev/index.html index bcf53848..2c164995 100644 --- a/dev/index.html +++ b/dev/index.html @@ -13,36 +13,9 @@ - - - -
-
-
- -
-
-
{{{ model | prettyJSON }}}
-
-
-
+ diff --git a/dev/main.js b/dev/main.js index 978180b0..896c21cf 100644 --- a/dev/main.js +++ b/dev/main.js @@ -1,78 +1,11 @@ -import Vue from "vue"; -import VueFormGenerator from "../src"; -import Schema from "./schema"; - $(function() { console.log($.fn.selectpicker); - - var vm = new Vue({ - el: "#app", - components: { - "vue-form-generator": VueFormGenerator.component - }, - - filters: { - prettyJSON: function(json) { - if (json) { - json = JSON.stringify(json, undefined, 4); - json = json.replace(/&/g, '&').replace(//g, '>'); - return json.replace(/("(\\u[a-zA-Z0-9]{4}|\\[^u]|[^\\"])*"(\s*:)?|\b(true|false|null)\b|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?)/g, function (match) { - var cls = 'number'; - if (/^"/.test(match)) { - if (/:$/.test(match)) { - cls = 'key'; - } else { - cls = 'string'; - } - } else if (/true|false/.test(match)) { - cls = 'boolean'; - } else if (/null/.test(match)) { - cls = 'null'; - } - return '' + match + ''; - }); - } - } - }, - - data: { - model: { - id: 1, - name: "John Doe", - type: "personal", - password: "J0hnD03!x4", - skills: [ - "Javascript", - "VueJS" - ], - email: "john.doe@gmail.com", - language: "en-GB", - age: 35, - dob: 348966000000, - rank: 6, - address: { - country: "United Kingdom", - city: "London", - street: "SW1A 5 Parliament St", - geo: { - lat: 51.501015, - lng: -0.126005 - } - }, - role: "admin", - created: 1461834815864, - bio: "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nullam non lacus porttitor, pellentesque odio sit amet, hendrerit felis. In turpis mauris, viverra a lacinia nec, fringilla ut nisi. Curabitur rutrum mattis risus, at dapibus nisl tempus et. Interdum et malesuada fames ac ante ipsum primis in faucibus. Phasellus eget elementum lorem. Pellentesque tempor nec ante ut molestie. Suspendisse imperdiet tempus hendrerit. Morbi a dignissim augue.", - status: true, + let App = require("./App.vue"); - }, - - schema: Schema, - - formOptions: { - validateAfterLoad: true, - validateAfterChanged: true - } + new Vue({ + el: "body", + components: { + App } }); - }); \ No newline at end of file diff --git a/package.json b/package.json index bcc26484..4bd5a70d 100644 --- a/package.json +++ b/package.json @@ -28,7 +28,6 @@ "css-loader": "0.23.1", "jade": "1.11.0", "jade-loader": "0.8.0", - "jquery": "2.2.3", "lodash": "4.11.1", "moment": "2.13.0", "node-sass": "3.6.0", diff --git a/webpack.dev.config.js b/webpack.dev.config.js index 0bfbee73..cbfcfcb5 100644 --- a/webpack.dev.config.js +++ b/webpack.dev.config.js @@ -52,10 +52,6 @@ module.exports = { publicPath: '/' }, plugins: [ - new webpack.ProvidePlugin({ - $: "jquery", - jQuery: "jquery" - }) ], module: { loaders: loaders