鍍金池/ 問答/HTML/ vue導(dǎo)入外部js文件中的函數(shù)報錯,is not a constructor

vue導(dǎo)入外部js文件中的函數(shù)報錯,is not a constructor

一個測試頁面,需要導(dǎo)入一個外部的HTML&js日歷插件,一開始出現(xiàn)babel問題,解決完又出現(xiàn)了這個問題,調(diào)試了一天實在沒轍求大佬們幫忙看看。
【報的錯誤】(錯誤描述:HelloWorld.vue?b82f:15 Uncaught TypeError: __WEBPACK_IMPORTED_MODULE_1__js_simple_calendar_js__.a is not a constructor)

圖片描述
報錯的是這一行
圖片描述

【test.vue】

<template>
  <div class="hello">
    <h1>{{ msg }}</h1>
    <h2>ssss</h2>

    <div id="cal"></div>

  </div>
</template>

<script>

import '../css/simple-calendar.css'
import  SimpleCalendar from '../js/simple-calendar.js'
var myCalendar = new SimpleCalendar('#cal');

export default {
  name: 'HelloWorld',
  data () {
    return {
      msg: 'Welcome to Your Vue.js App'
    }
  },mounted:function(){

  }
}
</script>

<!-- Add "scoped" attribute to limit CSS to this component only -->
<style scoped>
</style>

【插件部分HTML代碼 simple-calendar.js】


export default SimpleCalendar;
var SimpleCalendar = function () {
  //構(gòu)造函數(shù)

  function SimpleCalendar(query, options) {
    _classCallCheck(this, SimpleCalendar);

    //默認(rèn)配置
    this._defaultOptions = {
      width: '500px',
      height: '500px',
      language: 'CH', //語言
      showLunarCalendar: true, //陰歷
      showHoliday: true, //休假
      showFestival: true, //節(jié)日
      showLunarFestival: true, //農(nóng)歷節(jié)日
      showSolarTerm: true, //節(jié)氣
      showMark: true, //標(biāo)記
      onSelect: function onSelect() {},
      timeRange: {
        startYear: 1900,
        endYear: 2049
      },
      timeZone: "", //時區(qū)
      mark: {
        '2016-5-5': '上學(xué)'
      },
      theme: {
        changeAble: false,
        weeks: {
          backgroundColor: '#FBEC9C',
          fontColor: '#4A4A4A',
          fontSize: '20px'
        },
        days: {
          backgroundColor: '#ffffff',
          fontColor: '#565555',
          fontSize: '24px'
        },
        todaycolor: 'orange',
        activeSelectColor: 'orange',
        invalidDays: '#C1C0C0'
      }
    };

    //容器
    this.container = document.querySelector(query);

    this._defaultOptions.width = this.container.style.offsetWidth;
    this._defaultOptions.height = this.container.style.offsetHeight;

    //this._options = Object.assign({}, this._defaultOptions, options);

    //得到最終配置
    this._options = this.optionAssign(this._defaultOptions, options);

    this.create();
    .....
    }
  }
回答
編輯回答
空白格

export default SimpleCalendar;
放在最后一行

2018年2月19日 07:56