在线观看不卡亚洲电影_亚洲妓女99综合网_91青青青亚洲娱乐在线观看_日韩无码高清综合久久

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

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

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

圖片描述
報(bào)錯(cuò)的是這一行
圖片描述

【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', //語(yǔ)言
      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: "", //時(shí)區(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