Skip to content

Commit

Permalink
save
Browse files Browse the repository at this point in the history
  • Loading branch information
plantain-00 committed Jan 24, 2017
1 parent 2ee780b commit 1ce0da0
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 39 deletions.
3 changes: 3 additions & 0 deletions demo/vue/vendor.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
import "tslib";
import "vue";
import "vue-class-component";
3 changes: 1 addition & 2 deletions rev-static.config.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
{
"inputFiles": [
"demo/vue.js",
"demo/vue.vendor.js",
"demo/vue.bundle.js",
"demo/vue/index.ejs.html"
],
"outputFiles": [
Expand Down
41 changes: 4 additions & 37 deletions src/vue.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,44 +3,11 @@ import Component from "vue-class-component";

@Component({
template: `
<editor :schema="schema"
:initial-value="initialValue"
:theme="themeObject"
:locale="localeObject"
:icon="iconObject"
:readonly="readonly"
:required="true"
@update-value="updateValue(arguments[0])"
:dragula="dragula"
:md="md"
:hljs="hljs"
:forceHttps="forceHttps">
</editor>
`,
props: ["schema", "initialValue", "theme", "icon", "locale", "readonly", "dragula", "markdownit", "hljs", "forceHttps"],
props: [],
})
class JSONEditor extends Vue {
theme: string;
locale: string;
icon: string;
markdownit: typeof MarkdownIt;
hljs: typeof hljs;
forceHttps: boolean;

themeObject = common.getTheme(this.theme);
localeObject: common.Locale;
iconObject: common.Icon;
md = common.initializeMarkdown(this.markdownit, this.hljs, this.forceHttps);

constructor() {
super();
this.localeObject = common.getLocale(this.locale);
this.iconObject = common.getIcon(this.icon, this.localeObject);
}

updateValue(value: common.ValueType) {
this.$emit("update-value", value);
}
class Tree extends Vue {
}

Vue.component("tree", JSONEditor);
Vue.component("tree", Tree);
2 changes: 2 additions & 0 deletions webpack.config.vue.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
const webpack = require("webpack");
const path = require("path");

module.exports = {
entry: {
vue: "./demo/vue/index",
"vue.vendor": "./demo/vue/vendor"
},
output: {
path: path.join(__dirname, "demo"),
filename: "[name].bundle.js"
},
plugins: [
Expand Down

0 comments on commit 1ce0da0

Please sign in to comment.