Index.vue 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. <template>
  2. <div id="privacy" :class="{ app: true, block: type === 1 }">
  3. <div class="sk" v-if="!content">
  4. <br />
  5. <van-skeleton title :row="10" />
  6. </div>
  7. <news v-if="content" :item="{ content: content }" />
  8. </div>
  9. </template>
  10. <script>
  11. import { Skeleton as vanSkeleton } from "vant";
  12. import { currentUrlToParams } from "@/utils/common.js";
  13. import "vant/lib/skeleton/style";
  14. import news from "@/components/Detail/news.vue";
  15. export default {
  16. name: "app",
  17. data: function() {
  18. return {
  19. content: "",
  20. type: undefined
  21. };
  22. },
  23. methods: {
  24. onClickLeft() {
  25. history.go(-1);
  26. }
  27. },
  28. mounted() {
  29. let _this = this;
  30. window.privacy = function(html) {
  31. _this.content = html;
  32. };
  33. this.$pageParams = currentUrlToParams();
  34. this.type = this.$pageParams.pattern - 0;
  35. },
  36. beforeDestroy: function() {},
  37. components: { news, vanSkeleton }
  38. };
  39. </script>
  40. <style lang="scss">
  41. #privacy {
  42. height: 100%;
  43. overflow-y: scroll;
  44. .head {
  45. text-align: center;
  46. padding-bottom: 1em;
  47. padding-top: 0.5rem;
  48. .van-image {
  49. margin: 0 auto;
  50. }
  51. }
  52. }
  53. </style>