Commit 9a8fbe71 authored by 任建锋's avatar 任建锋

--

parent fe222d42
...@@ -283,7 +283,7 @@ export const projectStore = { ...@@ -283,7 +283,7 @@ export const projectStore = {
copyNode(state, {node, parentNode}) { copyNode(state, {node, parentNode}) {
// const parentChildren = parentNode.children || parentNode; // const parentChildren = parentNode.children || parentNode;
// const index = parentChildren.indexOf(node); // const index = parentChildren.indexOf(node);
//parentNode.children.push(node); // parentNode.children.push(node);
// parentChildren.push(parentChildren[index]); // parentChildren.push(parentChildren[index]);
const child = { const child = {
name:node.name, name:node.name,
......
...@@ -121,4 +121,7 @@ ...@@ -121,4 +121,7 @@
} }
} }
} }
.full-scrollbar{
height: 68vh;
}
} }
...@@ -3,6 +3,7 @@ ...@@ -3,6 +3,7 @@
:close-on-click-modal="false" :close-on-click-modal="false"
:append-to-body="true" :append-to-body="true"
:show-close="false" :show-close="false"
fullscreen
custom-class="details-dialog" custom-class="details-dialog"
> >
<el-tabs v-model="activeName"> <el-tabs v-model="activeName">
......
<template> <template>
<div> <div>
<el-scrollbar class="scrollbar" wrap-class="wrap-x-hidden" view-class="view"> <el-scrollbar class="scrollbar full-scrollbar" wrap-class="wrap-x-hidden" view-class="view">
<el-form @submit.native.prevent ref="form" :model="options" size="mini" label-position="right" <el-form @submit.native.prevent ref="form" :model="options" size="mini" label-position="right"
label-width="150px"> label-width="150px">
<el-form-item prop="pageTitle" :label="$t('Page title')"> <el-form-item prop="pageTitle" :label="$t('Page title')">
...@@ -46,7 +46,13 @@ ...@@ -46,7 +46,13 @@
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item prop="tpl" :label="$t('Template')"> <el-form-item prop="tpl" :label="$t('Template')">
<el-input type="textarea" v-model="options.tpl" :rows="10"/> <!-- <el-input type="textarea" v-model="options.tpl" :rows="10"/> -->
<codemirror ref="codeEditor"
v-model="options.tpl"
:options="cmOptions"
@cursorActivity="onCodeChange"
>
</codemirror>
</el-form-item> </el-form-item>
</el-form> </el-form>
</el-scrollbar> </el-scrollbar>
...@@ -59,10 +65,18 @@ ...@@ -59,10 +65,18 @@
<script> <script>
import {mapState, mapGetters, mapMutations} from 'vuex'; import {mapState, mapGetters, mapMutations} from 'vuex';
import {codemirror} from "vue-codemirror";
import 'codemirror/mode/javascript/javascript.js'
import 'codemirror/lib/codemirror.css'
import 'codemirror/theme/monokai.css'
import 'codemirror/addon/edit/closebrackets.js'
import 'codemirror/addon/hint/show-hint.js'
import 'codemirror/addon/hint/show-hint.css'
import 'codemirror/addon/hint/javascript-hint.js'
export default { export default {
name: "ProjectEditor", name: "ProjectEditor",
components: {}, components: {codemirror},
data() { data() {
const scaleMode = this.$t('scaleMode'); const scaleMode = this.$t('scaleMode');
const rendererType = this.$t('rendererType'); const rendererType = this.$t('rendererType');
...@@ -70,6 +84,16 @@ ...@@ -70,6 +84,16 @@
visible: false, visible: false,
scaleMode, scaleMode,
rendererType, rendererType,
cmOptions: {
tabSize: 2,
mode: 'text/javascript',
styleActiveLine: true,
theme: 'default',
lineNumbers: true,
line: true,
matchBrackets: true,
autoCloseBrackets: true,
}
} }
}, },
computed: { computed: {
...@@ -90,6 +114,10 @@ ...@@ -90,6 +114,10 @@
onSave() { onSave() {
this.modifyProject(); this.modifyProject();
}, },
onCodeChange(codemirror){
//codemirror.showHint();
//console.log(code);
}
} }
} }
</script> </script>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment