优化开发环境,提供搜索应用筛选
This commit is contained in:
@@ -6,8 +6,9 @@
|
|||||||
<ai-result v-if="result.tips" v-bind="result"/>
|
<ai-result v-if="result.tips" v-bind="result"/>
|
||||||
<input v-if="!!$route.query.code" class="codeText" :value="$route.query.code"/>
|
<input v-if="!!$route.query.code" class="codeText" :value="$route.query.code"/>
|
||||||
<div class="codeBtn" @click="handleLogin">去登录</div>
|
<div class="codeBtn" @click="handleLogin">去登录</div>
|
||||||
|
<input class="codeText" v-model="search" placeholder="搜索要查找的应用"/>
|
||||||
<div flex class="appsPane wrap">
|
<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>
|
</div>
|
||||||
</section>
|
</section>
|
||||||
</template>
|
</template>
|
||||||
@@ -22,6 +23,10 @@ export default {
|
|||||||
inject: ['root'],
|
inject: ['root'],
|
||||||
computed: {
|
computed: {
|
||||||
...mapState(['token', 'openUser', 'user']),
|
...mapState(['token', 'openUser', 'user']),
|
||||||
|
appsList() {
|
||||||
|
let {search} = this
|
||||||
|
return this.apps?.filter(e => !!search ? e.name.indexOf(search) > -1 : true) || []
|
||||||
|
},
|
||||||
currentApp() {
|
currentApp() {
|
||||||
return this.apps.find(e => e.key == this.$route.query.app) || {}
|
return this.apps.find(e => e.key == this.$route.query.app) || {}
|
||||||
}
|
}
|
||||||
@@ -29,7 +34,8 @@ export default {
|
|||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
result: {},
|
result: {},
|
||||||
apps: []
|
apps: [],
|
||||||
|
search: ""
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
|||||||
Reference in New Issue
Block a user