-
Notifications
You must be signed in to change notification settings - Fork 77
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
vuejs2.0 can not use this component #29
Comments
Considering there are so many issues without answers I think that project is abandoned. You have 3 options:
|
@Haixing-Hu do you have any progress on this ? 😄 |
I was able to make vue2 work with datetimepicker like this:
|
@DelightedD0D Could you help walk me through how you did this? I'm trying to get this datetime picker to work with vue 2 as well. I followed the instructions in the original readme for this, and then I created another component with the code you provided. I then registered it in my main.js and tried implementing it in another component, but its not working (its saying the "moment().tz" in mounted() is not a function. When I removed it, it then said the $(...).children(...).first(...).datetimepicker is not a function). When I removed that, all I was left with was an input field that didn't do anything >.< These are the dependencies that I'm using, and I have jquery loaded via a script tag in my index.html "dependencies": { Thank you so much for the help! |
Sure, I'll try to explain how I got mine working: First, Im using Laravel and Gulp so some things may be different for you. Step 1, ignore this repo and all of its stepsStep 2, download the jquery.datetimepicker files from:
Step 3, download the moment.js files from:
Step 4 In my gulpfile.js, I added the paths to the files in my project:const elixir = require('laravel-elixir');
require('laravel-elixir-vue-2');
// relative to /resources/assets/css/
var styles = [
//....
'lib/jquery.datetimepicker.min.css',
// ....
];
// relative to /resources/assets/js/
var scripts = [
// ....
'lib/moment.min.js',
'lib/moment-timezone-with-data.js',
'lib/jquery.datetimepicker.full.js',
// ....
];
// relative to /resources/assets/sass/
var sass = [
'app.scss'
];
// relative to /resources/assets/js/
var webpacks = ['app.js']; // app.js includes jquery, bootstrap, etc...
elixir(function(mix) {
mix.webpack(webpacks,'public/js/app.js')
.styles(styles)
.scripts(scripts)
.sass(sass);
}); Step 5 I created a file named
|
@DelightedD0D The last code works, but it's outdated now, because the latest version of datetime picker has renamed some of the original options and events. Also http://eonasdan.github.io/bootstrap-datetimepicker/Changelog/ |
@Haixing-Hu hello, when i update vuejs to 2.0 can not use this component, how can i fix this problem?
The text was updated successfully, but these errors were encountered: