提交 ec5f7d2a authored 作者: 王鹏飞's avatar 王鹏飞

bug fixes

上级 1cf4ea4c
<template>
<div class="article-list">
<article-list-item v-for="(item, index) in dataList" :data="item" :to="to" :key="index"></article-list-item>
<article-list-item v-for="(item, index) in dataList" :data="item" v-bind="$attrs" :key="index"></article-list-item>
<el-pagination
class="article-list-pagination"
layout="prev, pager, next"
......@@ -19,14 +19,13 @@ import ArticleListItem from './ArticleListItem.vue'
export default {
name: 'ArticleList',
components: { ArticleListItem },
inheritAttrs: false,
props: {
remote: { type: Object, default: () => ({}) },
// 是否含有翻页
hasPagination: { type: Boolean, default: true },
// 每页多少条数据
limit: { type: Number, default: 20 },
// 页面跳转地址
to: { type: [Function, String, Object] }
limit: { type: Number, default: 20 }
},
data() {
return {
......@@ -74,7 +73,6 @@ export default {
delete params[key]
}
}
console.log(params)
this.loading = true
return httpRequest(params)
.then(res => {
......
......@@ -18,6 +18,7 @@ import AppLink from '@/components/Link'
export default {
name: 'ArticleItem',
components: { AppLink },
inheritAttrs: false,
props: { data: { type: Object, required: true } },
methods: {
formatDate(value) {
......
<template>
<div>
<div class="app-link">
<!-- 外部链接跳转 -->
<a :href="href" :target="target" v-if="href"><slot /></a>
<!-- 站内跳转 -->
<nuxt-link :to="path" v-else-if="path"><slot /></nuxt-link>
<!-- 事件 -->
<div v-else-if="item.onClick" @click="item.onClick"><slot /></div>
<div v-else-if="data.onClick" @click="data.onClick"><slot /></div>
<template v-else><slot /></template>
</div>
</template>
......@@ -15,7 +15,7 @@ export default {
name: 'Link',
props: {
data: { type: Object, default: () => ({}) },
to: { type: [Function, String, Object] },
to: [String, Object, Function],
target: { type: String, default: '_blnak' }
},
computed: {
......@@ -23,7 +23,7 @@ export default {
return this.data.href || this.data.uri
},
path() {
if (Array.isArray(this.to)) {
if (typeof this.to === 'function') {
return this.to(this.data)
}
return this.data.path || this.to
......
......@@ -18,10 +18,11 @@
<script>
import TreeItem from './TreeItem'
import AppLink from '@/components/Link'
export default {
name: 'TreeItem',
props: { item: Object },
components: { TreeItem },
components: { TreeItem, AppLink },
data: function () {
return {
isOpen: false
......
......@@ -3,8 +3,8 @@
</template>
<script>
import PC from './pc'
import H5 from './h5'
import PC from './pc/Index'
import H5 from './h5/Index'
export default {
components: { PC, H5 },
computed: {
......
......@@ -30,7 +30,6 @@ export default {
},
data() {
return {
pageOptions,
courseData: [
{
title: this.$t('setCourse.tit1'),
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论