Index.vue 1013 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. <template>
  2. <div id="privacy" class="app">
  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. };
  21. },
  22. methods: {
  23. onClickLeft() {
  24. history.go(-1);
  25. }
  26. },
  27. mounted() {
  28. window.$privacy = function(html) {
  29. this.content = html;
  30. };
  31. this.$pageParams = currentUrlToParams();
  32. },
  33. beforeDestroy: function() {},
  34. components: { news, vanSkeleton }
  35. };
  36. </script>
  37. <style lang="scss">
  38. #privacy {
  39. height: 100%;
  40. overflow-y: scroll;
  41. .head {
  42. text-align: center;
  43. padding-bottom: 1em;
  44. padding-top: 0.5rem;
  45. .van-image {
  46. margin: 0 auto;
  47. }
  48. }
  49. }
  50. </style>