-
-
Notifications
You must be signed in to change notification settings - Fork 330
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Vue] UX Vue.js example for ux.symfony.com
- Loading branch information
Showing
19 changed files
with
821 additions
and
398 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
<template> | ||
<div v-if="packages.length === 0" class="alert alert-info">Sad trombone... we haven't built any components that | ||
match this search yet! | ||
</div> | ||
|
||
<div v-else class="row"> | ||
<a | ||
v-for="uxPackage in packages" | ||
:href="uxPackage.url" | ||
class="col-12 col-md-4 col-lg-3 mb-2" | ||
> | ||
<div class="components-container p-2"> | ||
<div class="d-flex"> | ||
<div | ||
class="live-component-img d-flex justify-content-center align-items-center" | ||
:style="{background: uxPackage.gradient}"> | ||
<img width="17" height="17" | ||
:src="uxPackage.imageUrl" | ||
:alt="`Image for the ${uxPackage.humanName} UX package`" | ||
/> | ||
</div> | ||
<h4 class="ubuntu-title ps-2 align-self-center"> | ||
{{ uxPackage.humanName }} | ||
</h4> | ||
</div> | ||
</div> | ||
</a> | ||
</div> | ||
</template> | ||
|
||
<script setup> | ||
defineProps({ | ||
packages: Array, | ||
}); | ||
</script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
<template> | ||
<div> | ||
<input | ||
v-model="search" | ||
class="form-control" | ||
type="search" | ||
placeholder="This search is built in Vue!" | ||
/> | ||
|
||
<div class="mt-3"> | ||
<PackageList :packages="filteredPackages" /> | ||
</div> | ||
</div> | ||
</template> | ||
|
||
<script setup> | ||
import { computed, ref } from 'vue'; | ||
import PackageList from "../components/PackageList"; | ||
const props = defineProps({ | ||
packages: Array, | ||
}); | ||
const search = ref(''); | ||
const filteredPackages = computed(() => { | ||
return props.packages.filter( | ||
uxPackage => uxPackage.humanName.toLowerCase().includes(search.value.toLowerCase()) | ||
); | ||
}); | ||
</script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
<template> | ||
<div> | ||
<input v-model="search" /> | ||
|
||
<div class="row"> | ||
<a v-for="uxPackage in filteredPackages" :href="uxPackage.url"> | ||
<img :src="uxPackage.imageUrl" /> | ||
<h4>{{ uxPackage.humanName }}</h4> | ||
</a> | ||
</div> | ||
</div> | ||
</template> | ||
|
||
<script setup> | ||
import { computed, ref } from 'vue'; | ||
const props = defineProps({ | ||
packages: Array, | ||
}); | ||
const search = ref(''); | ||
const filteredPackages = computed(() => { | ||
return props.packages.filter( | ||
uxPackage => uxPackage.humanName.includes(search.value) | ||
); | ||
}); | ||
</script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
{# | ||
"PackageSearch" mounts assets/vue/controllers/PackageSearch.vue. | ||
"packagesData" is dynamic data, which becomes the "packages" prop! | ||
#} | ||
|
||
<div {{ vue_component('PackageSearch', { | ||
packages: packagesData | ||
}) }}> | ||
Loading... <i class="fas fa-cog fa-spin fa-3x"></i> | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.