优化开发环境,提供搜索应用筛选

This commit is contained in:
aixianling
2021-12-20 10:15:54 +08:00
parent a715749c2a
commit e563bd7588

View File

@@ -6,8 +6,9 @@
<ai-result v-if="result.tips" v-bind="result"/>
<input v-if="!!$route.query.code" class="codeText" :value="$route.query.code"/>
<div class="codeBtn" @click="handleLogin">去登录</div>
<input class="codeText" v-model="search" placeholder="搜索要查找的应用"/>
<div flex class="appsPane wrap">
<b v-for="app in apps" :key="app.key" @tap="handleGotoApp(app)">{{ app.name }}</b>
<b v-for="app in appsList" :key="app.key" @tap="handleGotoApp(app)">{{ app.name }}</b>
</div>
</section>
</template>
@@ -22,6 +23,10 @@ export default {
inject: ['root'],
computed: {
...mapState(['token', 'openUser', 'user']),
appsList() {
let {search} = this
return this.apps?.filter(e => !!search ? e.name.indexOf(search) > -1 : true) || []
},
currentApp() {
return this.apps.find(e => e.key == this.$route.query.app) || {}
}
@@ -29,7 +34,8 @@ export default {
data() {
return {
result: {},
apps: []
apps: [],
search: ""
}
},
methods: {