如何在单个文件组件中使用vue-datetime-picker

时间:2017-01-13 15:34:09

标签: laravel laravel-5.3 vue.js

我正在尝试使用vue-datetime-picker

<vue-datetime-picker class="vue-picker4" name="picker4"
                             :model.sync="result4"
                             type="time"
                             language="en-IN"
                             time-format="LT">
</vue-datetime-picker>

import VueDatetimePicker from "vue-datetime-picker";

components: {
        "vue-datetime-picker": VueDatetimePicker
}

但我仍然收到错误

vue.js?3de6:525 [Vue warn]: Failed to mount component: template or render function not defined. 
(found in component <vue-datetime-picker>)

2 个答案:

答案 0 :(得分:3)

不幸的是,vue-datetime-picker无法使用vue.js 2

答案 1 :(得分:-1)

而不是import,请尝试require

var VueDatetimePicker = require("vue-datetime-picker");

components: {
   "vue-datetime-picker": VueDatetimePicker
}