guhongwei 5 lat temu
rodzic
commit
e1c5e04f82

+ 4 - 4
src/views/news/listDetail.vue

@@ -39,7 +39,7 @@
                 </el-col>
               </span>
               <span v-else>
-                <detailInfo :newsDetail="newsDetail"></detailInfo>
+                <newsDetail :details="details"></newsDetail>
               </span>
             </el-col>
           </div>
@@ -59,7 +59,7 @@ import top from '@/layout/common/top.vue';
 import menus from '@/layout/common/menus.vue';
 import foot from '@/layout/common/foot.vue';
 import newsList from './parts/newsList.vue';
-import detailInfo from './parts/detailInfo.vue';
+import newsDetail from './parts/newsDetail.vue';
 import { mapState, createNamespacedHelpers } from 'vuex';
 export default {
   name: 'listDetail',
@@ -69,7 +69,7 @@ export default {
     menus,
     foot,
     newsList,
-    detailInfo,
+    newsDetail,
   },
   data: function() {
     return {
@@ -93,7 +93,7 @@ export default {
       // 总数
       total: 10,
       // 详情
-      newsDetail: {
+      details: {
         title: '信息标题',
         source: '信息部',
         date: '2020-02-02',

+ 7 - 7
src/views/news/parts/detailInfo.vue

@@ -1,13 +1,13 @@
 <template>
-  <div id="detailInfo">
+  <div id="newsDetail">
     <el-row>
       <el-col :span="24" class="info">
-        <h3>{{ newsDetail.title }}</h3>
+        <h3>{{ details.title }}</h3>
         <div>
-          <span>文章来源:{{ newsDetail.source }}</span>
-          <span>时间:{{ newsDetail.date }}</span>
+          <span>文章来源:{{ details.source }}</span>
+          <span>时间:{{ details.date }}</span>
         </div>
-        <p>{{ newsDetail.content }}</p>
+        <p>{{ details.content }}</p>
       </el-col>
     </el-row>
   </div>
@@ -16,9 +16,9 @@
 <script>
 import { mapState, createNamespacedHelpers } from 'vuex';
 export default {
-  name: 'detailInfo',
+  name: 'newsDetail',
   props: {
-    newsDetail: null,
+    details: null,
   },
   components: {},
   data: function() {