Browse Source

更新代码

master
song 3 years ago
parent
commit
f7423c54db
  1. 4
      src/App.vue
  2. 4
      src/components/Detail/editor.vue

4
src/App.vue

@ -21,24 +21,20 @@ export default {
methods: { methods: {
setCode(path) { setCode(path) {
console.log('path: ', path);
router.options.routes.forEach(first => { router.options.routes.forEach(first => {
if(first && first.path && first.path === path){ if(first && first.path && first.path === path){
console.log('first.code: ',first, first.code);
localStorage.setItem('code', first.code) localStorage.setItem('code', first.code)
return; return;
}else{ }else{
if(first.children && first.children.length){ if(first.children && first.children.length){
first.children.forEach(second => { first.children.forEach(second => {
if(second && second.path && second.path === path){ if(second && second.path && second.path === path){
console.log('second.code: ', second.code);
localStorage.setItem('code', second.code) localStorage.setItem('code', second.code)
return; return;
}else{ }else{
if(second.children && second.children.length){ if(second.children && second.children.length){
second.children.forEach(third => { second.children.forEach(third => {
if(third && third.path && third.path === path){ if(third && third.path && third.path === path){
console.log('third.code: ', third.code);
localStorage.setItem('code', third.code) localStorage.setItem('code', third.code)
return; return;
} }

4
src/components/Detail/editor.vue

@ -4,8 +4,8 @@
<script> <script>
import {BASE_API} from '../../config'; import {BASE_API} from '../../config';
import E from 'wangEditor' // import E from 'wangEditor'
// import E from './wangEditor.min.js' import E from './wangEditor.min.js'
export default { export default {
name: 'editoritem', name: 'editoritem',
props:{ props:{

Loading…
Cancel
Save