W640H360.vue 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  1. <template>
  2. <div class="banner-W640H360">
  3. <div id="adfox_16387710654751845" v-if="$device.isMobile"></div>
  4. <div id="adfox_163877102156142976" v-else></div>
  5. </div>
  6. </template>
  7. <script>
  8. export default {
  9. mounted() {
  10. addEventListener("load", () => {
  11. this.$device.isMobile ? this.mobileBanner() : this.desktopBanner();
  12. });
  13. },
  14. watch:{
  15. $route (to, from){
  16. Ya.adfoxCode.reload('adfox_16387710654751845')
  17. Ya.adfoxCode.reload('adfox_163238723987728973')
  18. }
  19. },
  20. methods: {
  21. desktopBanner() {
  22. window.yaContextCb.push(() => {
  23. Ya.adfoxCode.create({
  24. ownerId: 279920,
  25. containerId: "adfox_163877102156142976",
  26. params: {
  27. pp: "g",
  28. ps: "dbpj",
  29. p2: "hiza",
  30. },
  31. });
  32. });
  33. },
  34. mobileBanner() {
  35. window.yaContextCb.push(() => {
  36. Ya.adfoxCode.create({
  37. ownerId: 279920,
  38. containerId: "adfox_16387710654751845",
  39. params: {
  40. pp: "g",
  41. ps: "dbpj",
  42. p2: "hkyq",
  43. },
  44. });
  45. });
  46. },
  47. },
  48. };
  49. </script>
  50. <style lang='less'>
  51. .banner-W640H360 {
  52. width: 100%;
  53. text-align: center;
  54. height: auto;
  55. max-width: 640px;
  56. position: relative;
  57. margin: 0 auto;
  58. // background-color: orange;
  59. // &::after {
  60. // content: "Интерскроллер";
  61. // position: absolute;
  62. // }
  63. div{
  64. margin-left: auto;
  65. margin-right: auto;
  66. div{
  67. margin-left: auto;
  68. margin-right: auto;
  69. div{
  70. margin-left: auto;
  71. margin-right: auto;
  72. }
  73. }
  74. }
  75. }
  76. </style>