导入到我的文件中。vue:
import AirbnbStyleDatepicker from 'vue-airbnb-style-datepicker'
import format from 'date-fns/format'
export default {
components: {
AirbnbStyleDatepicker
}
}
但是我遇到了错误:Failed to mount component: template or render function not defined.
package.json中的版本:
"date-fns": "^1.29.0",
"vue": "^2.5.2",
"vue-airbnb-style-datepicker": "^1.11.4",
错误:
答案 0 :(得分:1)
如果您遵循安装指南并在全球范围内进行注册,它将起作用:
import Vue from 'vue'
import App from './App.vue'
// import component and stylesheet
import AirbnbStyleDatepicker from 'vue-airbnb-style-datepicker'
import 'vue-airbnb-style-datepicker/dist/styles.css'
// see docs for available options
const datepickerOptions = {}
// make sure we can use it in our components
Vue.use(AirbnbStyleDatepicker, datepickerOptions)
https://mikaeledebro.gitbooks.io/vue-airbnb-style-datepicker/INSTALLATION.html#enable-plugin