feat: 支持文本模板,系统命令

This commit is contained in:
muwoo
2021-06-10 20:54:28 +08:00
parent 31e7e17cc9
commit 31d57fc404
29 changed files with 377 additions and 205 deletions

View File

@@ -0,0 +1,40 @@
import doc from './doc.js';
function getQueryVariable(variable) {
var query = window.location.search.substring(1);
var vars = query.split("&");
for (var i=0;i<vars.length;i++) {
var pair = vars[i].split("=");
if(pair[0] == variable){return pair[1];}
}
return(false);
}
const routes = [
{ path: '/doc', name: 'doc', component: doc },
]
const router = new VueRouter({
routes
})
new Vue({
el: '#app',
data: {
config: window.exports,
code: '',
current: {}
},
mounted() {
this.code = getQueryVariable('code');
this.current = this.config[this.code];
this.$router.push({
name: this.current.mode,
query: {
args: JSON.stringify(this.current.args),
rootPath: getQueryVariable('targetFile').replace('index.html', '')
},
})
},
router,
})