fix the user watcher
This commit is contained in:
parent
2cc7c3a99c
commit
c395d863f1
|
@ -21,7 +21,7 @@
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import { ref, computed, watch } from 'vue';
|
import { ref, computed, watch, toRefs } from 'vue';
|
||||||
import ProjectItem from './ProjectItem.vue';
|
import ProjectItem from './ProjectItem.vue';
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
|
@ -46,6 +46,10 @@ export default {
|
||||||
return props.user.projects && availableProjects.value.length > 0;
|
return props.user.projects && availableProjects.value.length > 0;
|
||||||
});
|
});
|
||||||
|
|
||||||
|
//const propsWithRefs = toRefs(props);
|
||||||
|
//const user = propsWithRefs.user;
|
||||||
|
const { user } = toRefs(props);
|
||||||
|
|
||||||
watch(enteredSearchTerm, function(newValue) {
|
watch(enteredSearchTerm, function(newValue) {
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
if (newValue === enteredSearchTerm.value) {
|
if (newValue === enteredSearchTerm.value) {
|
||||||
|
@ -53,7 +57,7 @@ export default {
|
||||||
}
|
}
|
||||||
}, 300);
|
}, 300);
|
||||||
});
|
});
|
||||||
watch(props.user, function() {
|
watch(user, function() {
|
||||||
enteredSearchTerm.value = '';
|
enteredSearchTerm.value = '';
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
Reference in New Issue