feat: 支持 uTools list 模板

This commit is contained in:
muwoo
2021-07-09 12:37:35 +08:00
parent f34d93691d
commit b08f4fab54
11 changed files with 144 additions and 10 deletions

28
static/plugins/tpl/doc.js Normal file
View File

@@ -0,0 +1,28 @@
export default {
template: `
<div class="doc-container">
<div class="menu">
<div @click="active = index" :class="active === index ? 'active item' : 'item'" v-for="(item, index) in menu">
<div class="title">{{item.t}}</div>
<div class="desc">{{item.d}}</div>
</div>
</div>
<iframe class="frame" :src="path" />
</div>
`,
data() {
return {
query: this.$route.query,
menu: [],
active: 0,
}
},
mounted() {
this.menu = JSON.parse(this.query.args).indexes || [];
},
computed: {
path() {
return decodeURIComponent(this.query.rootPath) + (this.menu[this.active] || {}).p
}
}
}