Search is automatically reset when an item is opened

This commit is contained in:
Alicia Sykes
2021-04-03 09:08:28 +01:00
parent dfdef736e2
commit fb60e63252
9 changed files with 84 additions and 42 deletions

View File

@@ -1,6 +1,6 @@
<template>
<el-tooltip placement="bottom" effect="dark" :content="description" :disabled="!description">
<a :href="url" :class="`item ${!icon && !svg? 'short': ''}`"
<a :href="url" :class="`item ${!icon? 'short': ''}`" v-on:click="$emit('itemClicked')"
tabindex="0" target="_blank" rel="noopener noreferrer">
<div class="tile-title" :id="`tile-${id}`">
<span class="text">{{ title }}</span>
@@ -50,6 +50,9 @@ export default {
};
},
methods: {
itemOpened() {
this.$emit('itemClicked');
},
isUrl(str) {
const pattern = new RegExp(/(http|https):\/\/(\w+:{0,1}\w*)?(\S+)(:[0-9]+)?(\/|\/([\w#!:.?+=&%!\-/]))?/);
return pattern.test(str);