Vue中使用mixins

List.js

import ListTitle from '@/components/ListTitle'
import ZgldhDatatables from '@/components/ZgldhDatatables'

var listMixin = {
  components: {
    ListTitle,
    ZgldhDatatables
  },
  data() {
    return {}
  },
  computed: {},
  methods: {}
}

export default listMixin

组件中使用mixin:

import ListMixin from '@/mixins/List'
export default {
  mixins: [ListMixin],
  components: {
    ReaderEditor,
    Echart
  },

 

posted @ 2020-08-01 15:28  haha-uu  阅读(215)  评论(0编辑  收藏  举报