_id.vue 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. <template>
  2. <div>
  3. <head-bar></head-bar>
  4. <el-container>
  5. <el-main style="padding: 0px">
  6. <el-row>
  7. <el-col :span="18" offset="3">
  8. <el-row>
  9. <el-col :span="24" style="text-align: center;margin: 20px 0;">
  10. <h2>{{news_info.newsInfoTitle}}</h2>
  11. <span>{{news_info.newsInfoAuthor}} {{news_info.newsInfoTime}}</span>
  12. </el-col>
  13. <el-col :span="24"style="padding: 20px" v-html="news_info.newsInfoContent">
  14. </el-col>
  15. </el-row>
  16. </el-col>
  17. </el-row>
  18. </el-main>
  19. </el-container>
  20. <foot-bar></foot-bar>
  21. </div>
  22. </template>
  23. <script>
  24. import {navList,newsList,dictList} from "../../static/js/index"
  25. export default {
  26. name: "_id",
  27. head(){
  28. return{
  29. title:"中关村公共资源论坛"
  30. }
  31. },
  32. data(){
  33. return{
  34. news_info:{
  35. newsInfoTitle:null,
  36. newsInfoAuthor:null,
  37. newsInfoTime:null,
  38. newsInfoContent:null
  39. }
  40. }
  41. },
  42. created() {
  43. this.getNewsInfo()
  44. // this.news_info.id=this.$route.params.id;
  45. // this.news_info.title=this.$route.params.title;
  46. },
  47. methods:{
  48. getNewsInfo(){
  49. if (this.$route.params.id!=null&&!isNaN(this.$route.params.id)){
  50. newsList({"newsInfoId":this.$route.params.id}).then(response=>{
  51. this.news_info=response.rows[0];
  52. })
  53. }
  54. }
  55. }
  56. }
  57. </script>
  58. <style scoped>
  59. </style>