Advertisement
Guest User

checkImageUrlAvailable()

a guest
Sep 24th, 2019
105
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.33 KB | None | 0 0
  1. <StackLayout>
  2. <StackLayout>
  3. <Image width="100%" margin="0" :src="checkIfImageUrlAvailable()" class="banner" />
  4. </StackLayout>
  5. </StackLayout>
  6.  
  7. export default {
  8. data() {
  9. return {
  10. item: {
  11. attachments: {},
  12. image: {}
  13. },
  14. isAndroidOs: null,
  15. isDownloading: false
  16. };
  17. },
  18. props: {
  19. itemSelected: {
  20. type: Object,
  21. default: {}
  22. }
  23. },
  24. props: ["itemSelected"],
  25.  
  26. methods: {
  27. getValue(resource, key) {
  28. return get(resource, key);
  29. },
  30. // imageNotFound(item) {
  31. // if (item.image == null) {
  32. // return getValue(item.image, ");
  33. // }
  34. // },
  35. checkIfImageUrlAvailable() {
  36. // CHECK IF ITEM URL IS THERE, IF NOT SHOW THE PLACEHOLDER, ELSE WE USE ITEM.IMAGE.URL
  37. // return either the placeholder or return the item.image.url
  38. if (!item.image.url) {
  39. return getValue("https://fakeimg.pl/300/");
  40. } else {
  41. return getValue(item.image, url);
  42. }
  43. },
  44.  
  45. beforeMount() {
  46. console.log(this.itemSelected);
  47. this.item = this.itemSelected;
  48. // this.isAndroidOs = myPlatform.android;
  49. // this.item = this.itemSelected;
  50. // this.getGeneralInformationDetail();
  51. firebase.analytics.logEvent({
  52. key: "select_content"
  53. });
  54. }
  55.  
  56. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement